Skip to content

Instantly share code, notes, and snippets.

@apeltzer
Created May 28, 2019 12:50
Show Gist options
  • Save apeltzer/0914f66c69203992a29763bb219e98da to your computer and use it in GitHub Desktop.
Save apeltzer/0914f66c69203992a29763bb219e98da to your computer and use it in GitHub Desktop.
MergeLanes
#Based on Stephen Turners and Wei Shen's ideas
# Works fine if your ID in the beginning is sort of (hehe) unique.
# Comment out the cat part to run the dry run and check whether your output makes sense.
ls *R1* | cut -d _ -f 1 | sort | uniq \
| while read id; do \
echo "$id*R1*.fastq.gz >> $id.R1.fastq.gz";
cat $id*R1*.fastq.gz >> $id.R1.fastq.gz;
echo "$id*R2*.fastq.gz >> $id.R2.fastq.gz";
cat $id*R2*.fastq.gz >> $id.R2.fastq.gz;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment