Results for "Trick"

Wire posts

  • Sort FASTA sequence by length: cat f1.fasta| awk '{if($0 ~ /^>/){printf "%st", $0}else{print length($0)"t"$0}}'| sort -k2n,2| awk '{print $1"n"$3}' > sequence.fasta #Sort #Fasta #Trick #Onliner

    3178 days ago

  • Display top 10 Mrmory resource intensive processes in order $ line=$(ps aux | head -n 1) && echo $line; ps aux | sort -nrk 5 | head #Display #Top10 #Memory #Processes #Linux #Trick

    3153 days ago

  • Search and replace the string 'this' with the string 'that' in the file filename. perl -p -i -e 's/this/that/g' filename #Perl #Trick #PerlOneLiner #Tipsoftheday #Replace #FindandReplace

    3153 days ago

  • Extract sequences by their ID from a fasta file. perl -ne 'if(/^>(\S+)/){$c=$i{$1}}$c?print:chomp;$i{$_}=1 if @ARGV' ids.txt sample1.fa #Extract #Sequences #IDs #Fasta #Perl #Trick #Oneliner

    3151 days ago

  • Remove the fasta description and just keep the identifier. perl -p -i -e 's/>(.+?) .+/>$1/g' sample1.fa #Perl #Oneliner #Trick #Tips #Fasta #Identifier #Remove

    3151 days ago

  • To uninstall a perl module $ cpanm --uninstall <Module::Name> #Perl #Trick #Uninstall #Module

    3006 days ago

  • Delete space from FASTA header: perl -pe 's/>\S+\K.+//' < file.fasta > new_file.fasta #PerlOneLiner #Trick #Perl #Space #Fasta

    2969 days ago

  • Print all text after a matching string perl -ne "print unless 1 .. m(String)" #Perl #OneLiner #String #Perl #Trick

    2965 days ago

  • Perl common flags http://perldoc.perl.org/functions/-X.html # Perl #Flags #Trick

    2962 days ago

  • Check if BAM file is sorted or not use: for F in `find . -name "*.bam"`; do echo $F; samtools index ${F} ; done #Sort #BAM #Trick

    2859 days ago