proch
|
codepad
|
|
proch
|
Saved pastes by proch:
#!/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) |
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) |
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) |
#!/bin/env perl
open MIOFILE, 'file_name';
while ($riga = <MIOFILE>) {
$numero_righe++;
|
view (7 lines) |
open MIOFILE, 'file_name';
while ($riga = <MIOFILE>) {
$numero_righe++;
}
print "$numero_righe\n";
|
view (5 lines, 1 line of output) |
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) |
$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) |
$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) |
my %genetic_code = (
'UCA' => 'S', # Serine
'UCC' => 'S', # Serine
'UCG' => 'S', # Serine
'UCU' => 'S', # Serine
|
view (66 lines) |
my %genetic_code = (
'UCA' => 'S', # Serine
'UCC' => 'S', # Serine
'UCG' => 'S', # Serine
'UCU' => 'S', # Serine
|
view (66 lines, 2 lines of output) |
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";
$pos = 0;
while ($codon = substr($seq, $pos, 3)) {
|
view (8 lines, 1 line of output) |
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";
# Per fare il ciclo devo sapere quanto lunga è la stringa
$lunghSeq = length($seq);
|
view (16 lines, 1 line of output) |
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";
# Per fare il ciclo devo sapere quanto lunga è la stringa
$lunghSeq = length($seq);
|
view (12 lines, 1 line of output) |
$seq = "GAGtatCTGGAAGACAGGCAGACTTTTCGCCACAGCGTGGTGGTACCTTATGAGCCACCCGAGGCCGGCT";
$lunghSeq = length($seq);
for ($pos = 0; $pos < $lunghSeq; $pos+=3) {
|
view (8 lines, 1 line of output) |
@sequences = ('AGAGTATATACA', 'AGAGATATCCACACAC', 'CCCATAATATATAT', 'GAGAGAAAAAAA');
$seq_number = 0;
for $seq (@sequences) {
$seq_number++;
|
view (8 lines, 16 lines of output) |
$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) |
$howmany = 0;
for ($i = 0; $i < 100; $i++) {
$total = 0;
while ($total < 27) {
$random = int(rand(11));
|
view (12 lines, 1 line of output) |
# 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) |
# 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) |
@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) |
# 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) |
# 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) |
# 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) |
# 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) |
# 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) |
#OPERAZIONI.PL
# Impostiamo due variabili numeriche
$primo_numero = 11;
$secondo_numero = 3;
|
view (28 lines, 8 lines of output) |
# 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) |
$quantevolte = 5;
# L'operatore "++" dopo una variabile numerica la incrementa di uno
$quantevolte++;
|
view (13 lines, 8 lines of output) |
$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) |
$primo = 205;
$secondo = 7;
$quoziente = $primo / $secondo;
$resto = $primo % $secondo;
|
view (11 lines, 2 lines of output) |
<?
// 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) |
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) |
$template_Name = 'Ciccio';
$a = ':)';
$x = '
QUesto è un #a# templato piuttosto complesso di nome #template_Name#.
';
|
view (11 lines, 7 lines of output) |
$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 IF shortcut
$varA = 13;
$varB = 4;
$valid = ($varA == $varB ? 'valid' : 'invalid');
|
view (6 lines, 1 line of output) |
# PERL TERNARY OPERATOR
$var= "AC9";
my $voc = ($var=~/[AEIOU]/ ? 1 : 0);
print "$var $voc\n";
|
view (5 lines, 1 line of output, 1 comment) |
@cig = ('37M','18M2D19M', '8M2I27M');
foreach $cigar (@cig) {
print "\n- $cigar ---\n";
my $position;
|
view (32 lines, 12 lines of output, 1 comment) |
$quality = ';;;;;;;;;;;9;7;;.7;393333';
$avg = avgqual($quality);
print "$quality
$avg
";
|
view (16 lines, 2 lines of output) |
# 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) |