Skip to content

Remove chromosome/scaffold name mangling for bed/vcf files#137

Merged
evancofer merged 3 commits intoFunctionLab:masterfrom
evancofer:master
Feb 11, 2020
Merged

Remove chromosome/scaffold name mangling for bed/vcf files#137
evancofer merged 3 commits intoFunctionLab:masterfrom
evancofer:master

Conversation

@evancofer
Copy link
Copy Markdown
Collaborator

Reference Issues/PRs

None

What does this implement/fix? Explain your changes.

Selene should no longer automatically add "chr" to the start of the chromosome/scaffold name for every record in a bed/vcf file.

What testing did you do to verify the changes in this PR?

Verified that specified changes did not cause existing prediction and VEP examples to fail.

@evancofer evancofer requested a review from kathyxchen January 28, 2020 17:47
@evancofer evancofer changed the title Make chromosome/scaffold name checking less rigid. Remove chromosome/scaffold name mangling for bed/vcf files Jan 28, 2020
@kathyxchen
Copy link
Copy Markdown
Collaborator

Thanks @evancofer! Was thinking about whether to remove the chr prepend thing entirely or not.
Could we instead modify to a line that checks if all the chromosomes in reference_sequence.get_chrs() begin with chr and Selene prepends with 'chr' only in those cases? (Maybe set a flag at the beginning check_chr and then if check_chr and 'chr' not in chrom...) I'm sure there are other/better ways to do it, haha.

@evancofer
Copy link
Copy Markdown
Collaborator Author

@kathyxchen This has been updated to include the suggested changes.

Copy link
Copy Markdown
Collaborator

@kathyxchen kathyxchen left a comment

Choose a reason for hiding this comment

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

LGTM after 1 adjustment (noted in my review comment) & all changes are tested for standard + nonstandard chromosome FASTA. Thank you!!

if 'CHR' == chrom[:3]:
chrom = chrom.replace('CHR', 'chr')
elif "chr" not in chrom:
elif "chr" not in chrom and check_chr is True:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

update to 'chr' not in chrom and check_chr

@evancofer evancofer merged commit ec315d9 into FunctionLab:master Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants