Skip to content

Instantly share code, notes, and snippets.

@yannickwurm
Created November 7, 2017 16:52
Show Gist options
  • Save yannickwurm/45d9c6ed5af34c6902af8f219beeb9e8 to your computer and use it in GitHub Desktop.
Save yannickwurm/45d9c6ed5af34c6902af8f219beeb9e8 to your computer and use it in GitHub Desktop.
fastq into 2 files, separating orphans from paired
egrep '^@' in.fq | cut -f 1 -d ' ' | sort | uniq -c > in.fq.counts
cat in.fq.counts | egrep " 1 " | ruby -pe 'gsub(/ +1 @/, "")' > in.fq.orphan_ids
cat in.fq.counts | egrep " 2 " | ruby -pe 'gsub(/ +2 @/, "")' > in.fq.paired_ids
then subseq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment