[ create a new paste ] login | about

proch

Name: Andrea Telatin
Email:
Site/Blog: http://perl.4ngs.com/
Location: Italy
Default language: Perl
Favorite languages:
About:

Saved pastes by proch:

Perl, pasted on Jul 14:
1
2
3
4
5
#!/usr/bin/env perl

# script che cerca numeri di cinque cifre tali da avere:
# - la prima cifra che indica il numero di zeri totali presente nel numero
# - la seconda cifra che indica il numero di uno totali nel numero...
...
view (36 lines, 1 line of output)
Plain Text, pasted on May 7:
1
2
3
4
5
108_F3	0	contig00698	5164	42	50M	*	0	0	ATGCTTTAGATGTACGGTAGAGAATNGTTGGCTCNGGGGCNACGCGACNC	>;9998898;:8;9557>>431-75346:0151,()'()'-./-'*'',.	X1:Z:1_50_S1E49A17L49_T3Q31_BS1	HI:i:1	IH:i:1
109_F3	0	contig00007	89894	47	49M	*	0	0	CTTGNACTGGAGGACAAACCGCACATACATGTGAAAATAGAGAGNCGAG	=7511;7986=97:;>====@;:::?=>63>;24120-//864/(/235	X1:Z:1_49_S1E48A22L48_T2Q27_BS1	HI:i:1	IH:i:1
110_F3	0	contig00285	18138	42	43M	*	0	0	AATCCAGGATCACTTTCATTTCTCTGCCAAGGAGCTCAGGCNG	=;:;;<86=?>;99;===>==96:;<8645:833782/171&,	X1:Z:1_43_S1E49A21L49_T3Q29_BS1	HI:i:1	IH:i:1
111_F3	16	contig00177	12689	46	48M	*	0	0	CTAATCTGGTNATTTTTCNATCCCGATCTCTTTCTGCTTCAACGTTTG	==?85:;;7688<;2-5>;8539:40/5:0,9>==7/))56.,+20*,	X1:Z:48_1_S1E47A20L47_T2Q28_BS1	HI:i:1	IH:i:1
112_F3	16	contig00048	26235	49	50M	*	0	0	AGCAAGGGCNTGGATTGATCATTATATAGAGAAATTGAAGTGCTCACGGG	>64<714:>><68:32667::895018:435:9636:555./::3++54.	X1:Z:50_1_S1E49A21L49_T2Q17_BS1	HI:i:1	IH:i:1
...
view (44 lines)
Plain Text, pasted on May 7:
1
2
3
4
5
108_F3	0	contig00698	5164	42	50M	*	0	0	ATGCTTTAGATGTACGGTAGAGAATNGTTGGCTCNGGGGCNACGCGACNC	>;9998898;:8;9557>>431-75346:0151,()'()'-./-'*'',.	X1:Z:1_50_S1E49A17L49_T3Q31_BS1	HI:i:1	IH:i:1
109_F3	0	contig00007	89894	47	49M	*	0	0	CTTGNACTGGAGGACAAACCGCACATACATGTGAAAATAGAGAGNCGAG	=7511;7986=97:;>====@;:::?=>63>;24120-//864/(/235	X1:Z:1_49_S1E48A22L48_T2Q27_BS1	HI:i:1	IH:i:1
110_F3	0	contig00285	18138	42	43M	*	0	0	AATCCAGGATCACTTTCATTTCTCTGCCAAGGAGCTCAGGCNG	=;:;;<86=?>;99;===>==96:;<8645:833782/171&,	X1:Z:1_43_S1E49A21L49_T3Q29_BS1	HI:i:1	IH:i:1
111_F3	16	contig00177	12689	46	48M	*	0	0	CTAATCTGGTNATTTTTCNATCCCGATCTCTTTCTGCTTCAACGTTTG	==?85:;;7688<;2-5>;8539:40/5:0,9>==7/))56.,+20*,	X1:Z:48_1_S1E47A20L47_T2Q28_BS1	HI:i:1	IH:i:1
112_F3	16	contig00048	26235	49	50M	*	0	0	AGCAAGGGCNTGGATTGATCATTATATAGAGAAATTGAAGTGCTCACGGG	>64<714:>><68:32667::895018:435:9636:555./::3++54.	X1:Z:50_1_S1E49A21L49_T2Q17_BS1	HI:i:1	IH:i:1
...
view (44 lines)
Perl, pasted on May 6:
1
2
3
4
5
#!/bin/env perl

open MIOFILE, 'file_name';
while ($riga = <MIOFILE>) {
  $numero_righe++;
...
view (7 lines)
Perl, pasted on May 6:
1
2
3
4
5
open MIOFILE, 'file_name';
while ($riga = <MIOFILE>) {
$numero_righe++;
}
print "$numero_righe\n";
view (5 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
5
for ($i = 0; $i < 1000; $i++) {
  $j = int(rand()**3*1000);
  #print "$j\n";
  $numero_di_numeri{$j}++;
}
...
view (9 lines, 479 lines of output)
Perl, pasted on May 5:
1
2
3
4
5
$numero_di_zeri = 0;
$numero_di_uni = 0;
$numero_di_otti = 0;
$numero_di_novantanovi = 0;
$numero_di_cinquecenti = 0;
...
view (28 lines, 1005 lines of output)
Perl, pasted on May 5:
1
2
3
4
5
$numero_di_zeri = 0;
$numero_di_uni = 0;
$numero_di_otti = 0;
$numero_di_novantanovi = 0;
$numero_di_cinquecenti = 0;
...
view (28 lines, 1005 lines of output)
Perl, pasted on May 5:
1
2
3
4
5
my %genetic_code = (
'UCA' => 'S', # Serine
'UCC' => 'S', # Serine
'UCG' => 'S', # Serine
'UCU' => 'S', # Serine
...
view (66 lines)
Perl, pasted on May 5:
1
2
3
4
5
my %genetic_code = (
'UCA' => 'S', # Serine
'UCC' => 'S', # Serine
'UCG' => 'S', # Serine
'UCU' => 'S', # Serine
...
view (66 lines, 2 lines of output)
Perl, pasted on May 5:
1
2
3
4
5
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";

$pos = 0;

while ($codon = substr($seq, $pos, 3)) {
...
view (8 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";

# Per fare il ciclo devo sapere quanto lunga è la stringa
$lunghSeq = length($seq);
...
view (16 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";

# Per fare il ciclo devo sapere quanto lunga è la stringa
$lunghSeq = length($seq);
...
view (12 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
5
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";

$lunghSeq = length($seq);

for ($pos = 0; $pos < $lunghSeq; $pos+=3) {
...
view (8 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
5
@sequences = ('AGAGTATATACA', 'AGAGATATCCACACAC', 'CCCATAATATATAT', 'GAGAGAAAAAAA');

$seq_number = 0;
for $seq (@sequences) {
  $seq_number++;
...
view (8 lines, 16 lines of output)
Perl, pasted on May 5:
1
2
3
4
5
$sum = 0;
@numbers = (24, -4, 2.42, 494.02, 120, 0, 1, 0, 1.22);
 
foreach $i (@numbers) {
  $sum += $i;
...
view (17 lines, 2 lines of output)
Perl, pasted on May 5:
1
2
3
4
5
$howmany = 0;
for ($i = 0; $i < 100; $i++) {
  $total = 0;
  while ($total < 27) {
    $random = int(rand(11));
...
view (12 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
5
# Create a variable to store how many random were generated at the end.
$howmany = 0;
$total = 0;

while ($total < 27) {
...
view (10 lines, 1 line of output)
Perl, pasted on May 5:
1
2
3
4
5
# Create a variable to store how many random were generated at the end.
$howmany = 0;

while ($total < 27) {
   $random = int(rand(11));
...
view (9 lines, 1 line of output)
Perl, pasted on May 4:
1
2
3
4
5
@numeri = (3,66,2,34,12,57);
$lunghezza = 0;

# Inizializzo due variabili con il primo numero dell'array
# serviranno a tenere minimo e massimo
...
view (31 lines, 11 lines of output)
Perl, pasted on May 4:
1
2
3
4
5
# Create a variable to store how many random were generated at the end.
$howmany = 0;

while ($total < 100) {
   $random = int(rand(13));
...
view (15 lines, 16 lines of output)
Perl, pasted on Apr 18:
1
2
3
4
5
use strict;
my @prova  = (2, 3, 9, 10, 2929);

print "
 Elemento #1: $prova[4]\n
...
view (6 lines, 4 lines of output)
Perl, pasted on Apr 15:
1
2
3
4
5
for ($i=0; $i<20; $i++) {

  $c++;
  $x += 4;
  print "$c\t$x\t";
...
view (11 lines, 20 lines of output)
Perl, pasted on Apr 12:
1
2
3
4
5
# Voglio giocare 8 numeri al superenalotto, di cui tre gia decisi. #
#Li voglio scrivere in un array
@schedina = (19, 6, 82);

# Adesso scrivere un codice che aggiunga all'array altri 5 interi casuali da 1 a 90
...
view (10 lines)
Perl, pasted on Apr 10:
1
2
3
4
5
# un programma per contare il numero di k-meri in una sequenza

# questa variabile contiene una sequenza di basi sotto forma di stringa
my $sequence = 'CGAUCGAUGCUAGCUAGCUGGUACGUAGAAAAUAUUUAAGCUAGCUUCUGCAUCUA';
# questa variabile contiene k, la lunghezza dei k-meri
...
view (30 lines, 18 lines of output)
Perl, pasted on Apr 10:
1
2
3
4
# un programma per contare il numero di adenine in una sequenza

# questa variabile contiene una sequenza di basi sotto forma di stringa
my $sequence = 'ACCttGACaTCGACatCTACGGaTAGcgCTA';
...
view (33 lines, 8 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
5
$number = 3;

if ($number == 3) {
	print " Three is the magic number!\n";
} else {
...
view (7 lines, 1 line of output)
Perl, pasted on Apr 7:
1
2
3
4
5
# Questo programma introduce le variabili che contengono testo
# sono indistinguibili da quelle numeriche: iniziano sempre per $

$stringa = 'AGAGCTAGCTGACTGTACGTAC';
$base = 'A';
...
view (26 lines, 14 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
5
#OPERAZIONI.PL

# Impostiamo due variabili numeriche
$primo_numero = 11;
$secondo_numero = 3;
...
view (28 lines, 8 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
# SECONDO.PL

$primo_numero = 10;
$secondo_numero = 3;
...
view (7 lines, 2 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
5
# PRIMO.PL
# in perl i commenti iniziano con un "#". 
# Tutto cio' che segue il "#" viene ignorato. 

print  "Hello World!\n";
view (5 lines, 1 line of output)
Perl, pasted on Apr 7:
1
2
3
4
$quantevolte = 5;

# L'operatore "++" dopo una variabile numerica la incrementa di uno
$quantevolte++;
...
view (13 lines, 8 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
5
$quantevolte = 5;

for ($contatore = 1; $contatore <= $quantevolte; $contatore++) {
    print "Eseguo questo ciclo $quantevolte volte, questa è la $contatore.\n";
}
view (5 lines, 5 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
5
$primo = 205;
$secondo = 7;

$quoziente = $primo / $secondo;
$resto = $primo % $secondo;
...
view (11 lines, 2 lines of output)
Perl, pasted on Apr 7:
1
2
3
4
$nome = 'Ciccio';
$cognome = 'Pasticcio';

$nome_completo = $nome.' '.$cognome;
...
view (6 lines, 1 line of output)
PHP, pasted on Jul 16:
1
2
3
4
5
<?
// Get file modification date
$filename = 'somefile.txt';
if (file_exists($filename)) {
    echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
...
view (14 lines, 5 lines of output)
Perl, pasted on Jul 7:
1
2
3
4
5
    my @nums = (0..9,'a'..'z','A'..'Z');
    my %nums = map { $nums[$_] => $_ } 0..$#nums;

    # convert 4234179 to base 42
    print to_base(62, 4234179)."\n";
...
view (33 lines, 2 lines of output)
Perl, pasted on Jun 19:
1
2
3
4
5
$template_Name = 'Ciccio';
$a = ':)';
$x = '
QUesto è un #a# templato piuttosto complesso di nome #template_Name#.
';
...
view (11 lines, 7 lines of output)
Perl, pasted on Jun 3:
1
2
3
4
5
$a = 'LAGAZZALADRONACAAAAAAAAAAACGATCGTCACGACGGGGGGGGGGGGGGGGGGGGGGFIGACULO';
$q = '123712845723560877345918419082309480923840928230480923849389482394892';

while ($a=~/(\w{4})(A{5,}|C{5,}|G{5,}|T{5,})(\w{4})/g) {
  print "$1 $2 $3 - $-[0] $-[1] $-[2] * $+[0] \n";
...
view (8 lines, 4 lines of output)
Perl, pasted on Nov 17:
1
2
3
4
# Perl IF shortcut
$varA = 13;
$varB = 4;
$valid =  ($varA == $varB ? 'valid' : 'invalid');
...
view (6 lines, 1 line of output)
Perl, pasted on Nov 17:
1
2
3
4
5
# PERL TERNARY OPERATOR

$var= "AC9";
my $voc = ($var=~/[AEIOU]/ ? 1 : 0);
print "$var $voc\n";
view (5 lines, 1 line of output, 1 comment)
Perl, pasted on Nov 16:
1
2
3
4
5
$FLAG = 16;


if ($FLAG & 0x1)  {
  print "0 OK $FLAG\n";
...
view (46 lines, 8 lines of output)
Perl, pasted on Nov 16:
1
2
3
4
5
@cig = ('37M','18M2D19M', '8M2I27M');

foreach $cigar (@cig) {
print "\n- $cigar ---\n";
my $position;
...
view (32 lines, 12 lines of output, 1 comment)
Perl, pasted on Nov 15:
1
2
3
4
#!/usr/bin/perl

use strict;
use warnings;
...
view (15 lines, 3 lines of output)
Perl, pasted on Apr 23:
1
2
3
4
5
$quality = ';;;;;;;;;;;9;7;;.7;393333';
$avg = avgqual($quality);
print "$quality
$avg
";
...
view (16 lines, 2 lines of output)
Perl, pasted on Mar 27:
1
2
3
4
5
boxprint("
My program v. 1.0

Parameters:
FASTA-filename Coverage ReadLength");
...
view (14 lines)
Perl, pasted on Mar 27:
1
2
3
4
5
boxprint("
My program v. 1.0

Parameters:
FASTA-filename Coverage ReadLength");
...
view (38 lines, 7 lines of output)
Perl, pasted on Mar 27:
1
2
3
4
5
boxprint("
My program v. 1.0

Parameters:
FASTA-filename Coverage ReadLength");
...
view (24 lines, 7 lines of output)
Perl, pasted on Mar 15:
1
2
3
4
5
# Let's put a sequence in the $sequence
# I wrote it in three lines just for clarity!
$sequence = 'ACACGTACGTACTACGTAGCTACGACGATCGTACGTAGCACTGAATTCGGACG';
$sequence.= 'ACGTACGTACGTACGTAGCTCGATCGACGTACGTAGCTAGCACAGCTAGCTGA';
$sequence.= 'CGACGTAGCTACGTACGTCACGAATTCGCGATCGTACGTAGCTGTACGACTAG';
...
view (22 lines, 5 lines of output)
Perl, pasted on Mar 15:
1
2
3
4
5
#!/usr/bin/perl

# Questo hash associa ad ogni dinucleotide un colore (0,1,2,3)
my %cs = ('AA' => 0, 'CC' => 0, 'TT' => 0, 'GG' => 0,
'CA' => 1, 'AC' => 1, 'TG' => 1, 'GT' => 1,
...
view (28 lines, 3 lines of output)