Bash command to count reads in fastq file !
#ref fastq file #ref1_1.fq) echo $(( $(wc -l852 days ago
852 days ago
845 days ago
Bash script to find difference between two files !
#lines which are exist only in file2: grep -Fxvf file1 file2 > file3 #lines which are exist only in file1: grep -Fxvf file2 file1 > file3 #lines which are exist in both files: grep -Fxf file1 file2 > file3833 days ago
Commands to Find and replace in file(s0) !
#Use SED sed -i 's/my/your/g' test.txt test2.txt test3.txt #Use FIND and SED find . -name *.txt -exec sed -i 's/my/your/g' {} \; #Use AWK awk '{sub(/{OLD_TERM}/,{NEW_TERM}); print}' {file} awk '{sub(/my/,your); print}' test.txt awk '{gsub(/i/,"a"); print}' test.txt830 days ago
Bash command to explore assembly summary genbank !
wget https://ftp.ncbi.nlm.nih.gov/genomes/genbank/assembly_summary_genbank.txt pip3 install csvkit csvcut -t -K 1 -c 'excluded_from_refseq' assembly_summary_genbank.txt \ | tail -n +2 | tr ";" "\n" \ | sed -e 's/^ //' -e 's/ $//' | grep -v '""' \ | sort | uniq -c | sort -nr829 days ago
Bash script to convert multiline fasta to single line fasta !
#file.fa is multiline fasta awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);} END {printf("\n");}' < file.fa827 days ago
Command line to move all files from a directory !
find ~/Downloads/ -type f -print0 | xargs -0 mv -t ~/Videos779 days ago
778 days ago
Awk command to keep only short the fasta header !
awk '/^>/ {$0=$1} 1' file.fasta770 days ago