I have paired-end reads (gene-regions-exons) that contains 200 individuals and I want to include all the sample names in the read group. I have a text file in a single column and tried to include the readgroup when aligning
file=($(cat samples.txt)) bwa mem -M -R "@RG\tID:Library1\tSM:$file\tPL:Illumina\tLB:lib_2x250\tDS:hg19" hg19.ref R1.fastq.gz R2.fastq.gz > file.sam
But it doesn't work, the sam file generated includes only the last sample from the file samples.txt .
Also, once the bam files have been generated, is it possible to split the files based on individuals ?