This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering unmapped reads from BAM files

I am applying the GATK best practices for variant calling pipeline.

By applying the picard addOrReplaceReadGroups I got the error: "invalid_mapping_quality", I read the post Final Solution For "Mapq Should Be 0 For Unmapped Read.". So decided to remove unmapped reads with samtools view -bF 4.

My question is since I will apply the GATK base recalibrator, is it better to set QC = 0 to the reads that are unmapped and how would I do this? Or removing them is the best practice?

Best Regards, Manuel

bam gatk

Thanks! Is there any flag for ignoring this error with picard addOrReplaceReadGroups? And for example for estimating TMB from BAM files would it be a problem?

I did this:

srun /mnt/beegfs/apptainer/images/picard_latest.sif java -XX:ParallelGCThreads=40 -jar 
/usr/picard/picard.jar AddOrReplaceReadGroups  -I "$SORTED_BAM" -O "$OUTPUT" -RGID 4 - 
RGLB lib1 -RGPL ILLUMINA -RGPU unit1 -RGSM 20 -VALIDATION_STRINGENCY "LENIENT"

It generated the output file but still showed error. I proceded with doing the next step picard MarkDuplicates with the same flag "-VALIDATION_STRINGENCY ", error was displayed again yet it generated output? Should I keep adding this flag for the rest of the pipeline whenever use picard?

0 answers

No answers yet.

Log in to answer this question.