Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TCLamnidis
Copy link
Collaborator

@TCLamnidis TCLamnidis commented Nov 18, 2021

#808

Changes:

  • When mapping, assign the SM field of read groups to the sample name instead of the library Id.
  • Deactivate replacement of read headers upon library merging.
  • Flexible filtering for map and base quality when genotyping with pileupcaller.

This combination (in my small testing case) skips all the fiddling with read groups manually, retains all read group information and still produces a single genotyped individual per BAM within gatk UG.

Still testing a couple of things, but this should retain all the library/sequencing information within the final bams produced.

Added Parameters:

  • pileupcaller_min_map_quality. Default is 30. Changes the minimum mapping quality used in mpileup creation for pileupcaller. Affects samtools mpileup -q parameter.
  • pileupcaller_min_base_quality. Default is 30. Changes the minimum base quality used in mpileup creation for pileupcaller. Affects samtools mpileup -Q parameter.

PR checklist

  • This comment contains a description of changes (with reason).
  • Make sure your code lints (nf-core lint .).
  • Ensure the test suite passes (nextflow run . -profile test,docker).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@github-actions
Copy link

This PR is against the master branch ❌

  • Do not close this PR
  • Click Edit and change the base to dev
  • This CI test will remain failed until you push a new commit

Hi @TCLamnidis,

It looks like this pull-request is has been made against the nf-core/eager master branch.
The master branch on nf-core repositories should always contain code from the latest release.
Because of this, PRs to master are only allowed if they come from the nf-core/eager dev branch.

You do not need to close this PR, you can change the target branch to dev by clicking the "Edit" button at the top of this page.
Note that even after this, the test will continue to show as failing until you push a new commit.

Thanks again for your contribution!

@TCLamnidis TCLamnidis added the WIP Work in progress label Nov 18, 2021
@github-actions
Copy link

Markdown linting is failing

To keep the code consistent with lots of contributors, we run automated code consistency checks.
To fix this CI test, please run:

  • Install markdownlint-cli
  • Fix the markdown errors
    • Automatically: markdownlint . --config .github/markdownlint.yml --fix
    • Manually resolve anything left from markdownlint . --config .github/markdownlint.yml

Once you push these changes the test should pass, and you can hide this comment 👍

We highly recommend setting up markdownlint in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!

Thanks again for your contribution!

@TCLamnidis TCLamnidis changed the base branch from master to dev November 18, 2021 15:21
@TCLamnidis TCLamnidis self-assigned this Nov 18, 2021
@TCLamnidis TCLamnidis linked an issue Nov 18, 2021 that may be closed by this pull request
"type": "number",
"description": "Minimum percent identity alignments are required to have to be reported. Recommended to set same as MALT parameter.",
"default": 85,
"default": 85.0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"default": 85.0,
"default": 85,

@TCLamnidis TCLamnidis requested a review from jfy133 November 23, 2021 15:03
Copy link
Member

@jfy133 jfy133 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly cleanup things but otherwise LGTM

main.nf Outdated
## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/
picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT
samtools index ${libraryid}_seqtypemerged_rg.bam ${size}
# picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT
# picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT
Suggested change
# picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT
# picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${libraryid}_seqtypemerged.bam O=${libraryid}_seqtypemerged_rg.bam RGID=1 RGLB="${libraryid}_seqtypemerged" RGPL=illumina RGPU=4410 RGSM="${libraryid}_seqtypemerged" VALIDATION_STRINGENCY=LENIENT

I would remove the entire line, not leave it commented

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also remove the comment as well if necessary

main.nf Outdated
## Have to set validation as lenient because of BWA issue: "I see a read stands out the end of a chromosome and is flagged as unmapped (flag 0x4). [...]" http://bio-bwa.sourceforge.net/
picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_rmdup.bam O=${samplename}_libmerged_rg_rmdup.bam RGID=1 RGLB="${samplename}_merged" RGPL=illumina RGPU=4410 RGSM="${samplename}_merged" VALIDATION_STRINGENCY=LENIENT
samtools index ${samplename}_libmerged_rg_rmdup.bam ${size}
# picard -Xmx${task.memory.toGiga()}g AddOrReplaceReadGroups I=${samplename}_libmerged_rmdup.bam O=${samplename}_libmerged_rg_rmdup.bam RGID=1 RGLB="${samplename}_merged" RGPL=illumina RGPU=4410 RGSM="${samplename}_merged" VALIDATION_STRINGENCY=LENIENT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment above applies to all lib merges

TCLamnidis and others added 2 commits November 23, 2021 21:19
@TCLamnidis TCLamnidis removed the WIP Work in progress label Nov 24, 2021
@jfy133 jfy133 merged commit b567e33 into dev Nov 24, 2021
@TCLamnidis TCLamnidis deleted the retain_read_group_info branch January 12, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain read group information in bam merging steps

3 participants