Results for "PerlTrick"

Wire posts

  • Print all possible 2 combination of words ( ATGC): $letter = join',','A','T','G','C'; @abc=glob "{$letter}{$letter}"; foreach (@abc) { print "$_\n"; } #Perl #PerlTrick #TipsOftheDay

    3225 days ago

  • Print all the values between 15 to 17. perl -ne 'print if 15 .. 17' file #Perl #PerlTrick #Range

    3011 days ago

  • Remove tab with comma in file: perl -lpe 's/\t/,/g' < flattened_line_0.fa.data > output.csv #PerlTrick #PerlO,liner #Perl #Tab #Comma

    2834 days ago

  • Replace space with tab: perl -lpe 's/\s/\t/g' < trf_file.dat > outfile.txt #TRF #Tab #Space #Replace #Perl #PerlTrick #PerlOneliner

    2832 days ago

  • Rename the fasta name perl -ane 'if(/\>/){$a++; @foo = split /\s+/;$_ = join '_', @foo; print "$_\n"}else{print;}' your.fasta > new.fa #PerlTrick #PerlOneliner #Perl

    2791 days ago

  • Extract fasta sequence by Ids: perl -ne 'if(/^>(\S+)/){$c=grep{/^$1$/}qw(id1 id2)}print if $c' fasta.file #Perl #PerlOneliner #PerlTrick #Extract #Ids #Fasta

    2790 days ago

  • Slice on the fly with perl: my ($username, $real_name) = (split /:/, $str)[0, 4]; #Perl #PerlTrick #Split

    2750 days ago