Created
November 22, 2023 16:55
-
-
Save slavailn/258ed33a0bca67b8b5296b0dde58b7a6 to your computer and use it in GitHub Desktop.
Merge fastq files that belong to the same sample, but were generated from different lanes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Taken from https://github.com/stephenturner/mergelanes/issues/1 | |
# Exercise caution, does not work accurately in every case: | |
# Not working accurately for sample IDs like "A11_Barcodexxx_S11_L001_R1_001". | |
# It cat together all L001 pertaining to sample ID A11 with different barcodes also | |
ls *R1* | cut -d _ -f 1 | sort | uniq \ | |
| while read id; do \ | |
cat $id*R1*.fastq.gz > $id.R1.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