Useful commands
This post is my own “repository” of useful linux commands, which I (or SirShurf) have found, changed and used. You can take them, you can ask questions, I will try to answer.
Renaming files in directory
This example replaces “vcf.gz.recode” by “SNP”
for f in *.vcf; do echo “$f”; a=”$(echo $f | sed s/vcf.gz.recode/SNP/)”; mv “$f” “$a”; done
bgzip all files in current directory (but you have to check the pass to bgzip!)
for f in *.vcf; do echo “$f”; ../../tabix-0.2.6/bgzip “$f”; done
make index files (.tbi) to all bgzipped files in current directory (but you have to check the pass to tabix 🙂 )
for f in *.gz; do echo “$f”; ../../tabix-0.2.6/tabix -p vcf “$f”; done

No comments
Be the first one to leave a comment.