generated from snakemake-workflows/snakemake-workflow-template
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update parameters and callsets #34
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
34a54e1
fix: increase max read depth
FelixMoelder 8ec4865
update release
FelixMoelder dbece4e
update github action
FelixMoelder 1a0a08e
Update Snakefile
FelixMoelder c447e75
minor changes
FelixMoelder 6c48ff1
Merge branch 'fix/update_config' of github.com:snakemake-workflows/dn…
FelixMoelder 2266cc0
update varlociraptor params
FelixMoelder 1a4d9c8
clean
FelixMoelder 64d771f
Fix scenario
FelixMoelder 6830c58
update pathogenic callset
FelixMoelder 69d1374
update callset
FelixMoelder 2e84e7d
Merge branch 'main' into fix/update_config
FelixMoelder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,20 @@ __definitions__: | |
samples = params.samples.set_index("alias") | ||
if "ffpe" not in samples.columns: | ||
samples["ffpe"] = pd.NA | ||
- sex = samples.loc["tumor", "sex"] | ||
- sex = samples.loc[["tumor"], "sex"] | ||
- | | ||
if pd.isna(sex) or sex not in ["male", "female"]: | ||
raise ValueError(f"Unsupported sex in sample sheet (also ensure that sample sheet is entirely tab separated): {sex}") | ||
- is_ffpe = samples.loc["tumor", "ffpe"] | ||
if pd.isna(sex).any() or len(sex.unique()) != 1 or sex.iloc[0] not in ["male", "female"]: | ||
raise ValueError(f"Unsupported sex in sample sheet (also ensure that sample sheet is entirely tab separated): {sex}") | ||
- is_ffpe = samples.loc[["tumor"], "ffpe"].all() | ||
- | | ||
if len(samples.loc[["tumor"], "ffpe"].unique()) != 1: | ||
raise ValueError(f"All samples within a group must to be either ffpe or not.") | ||
- | | ||
if len(samples.loc[["tumor"], "purity"].unique()) != 1: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each alias should occur only once in a group. We should also check for that when validating the sample sheet. If there are two panels for a patient we could name the two tumors tumor_panelname1 and 2. the scenario could support that by looking for the prefix tumor. |
||
raise ValueError(f"All samples within a group need to have the same purity.") | ||
- | | ||
def contamination(): | ||
return 1.0 - float(samples.loc["tumor", "purity"]) | ||
return 1.0 - float(samples.loc[["tumor"], "purity"].iloc[0]) | ||
|
||
species: | ||
heterozygosity: 0.001 | ||
|
@@ -41,7 +47,7 @@ species: | |
?if "normal" in samples.index: | ||
samples: | ||
tumor: | ||
sex: ?sex | ||
sex: ?sex.iloc[0] | ||
somatic-effective-mutation-rate: 1e-6 | ||
inheritance: | ||
clonal: | ||
|
@@ -51,7 +57,7 @@ species: | |
by: normal | ||
fraction: ?contamination() | ||
normal: | ||
sex: ?sex | ||
sex: ?sex.iloc[0] | ||
somatic-effective-mutation-rate: 1e-6 | ||
|
||
events: | ||
|
@@ -61,7 +67,7 @@ species: | |
loh_or_amplification: "normal:0.5 & tumor:[0.9,1.0[" | ||
germline: "(normal:0.5 & tumor:[0.0,0.9[) | (normal:1.0 & tumor:[0.0,1.0])" | ||
?if is_ffpe: | ||
ffpe_artifact: "($ffpe_subst) & tumor:]0.0,0.05[" | ||
ffpe_artifact: "normal:0.0 & (($ffpe_subst) & tumor:]0.0,0.05[)" | ||
somatic_tumor_low: "normal:0.0 & ((($ffpe_subst) & tumor:]0.05,0.1[) | (!($ffpe_subst) & tumor:]0.0,0.1[))" | ||
?else: | ||
somatic_tumor_low: "normal:0.0 & tumor:]0.0,0.1[" | ||
|
@@ -71,19 +77,19 @@ species: | |
tumor: | ||
resolution: 0.01 | ||
universe: "[0.0,1.0]" | ||
sex: ?sex | ||
sex: ?sex.iloc[0] | ||
contamination: | ||
by: normal | ||
fraction: ?contamination() | ||
normal: | ||
universe: "0.0 | 0.5 | 1.0" | ||
sex: ?sex | ||
sex: ?sex.iloc[0] | ||
|
||
events: | ||
somatic_tumor_high: "normal:0.0 & tumor:[0.1,1.0]" | ||
germline: "(normal:0.5 & tumor:0.5) | (normal:1.0 & tumor:1.0)" | ||
?if is_ffpe: | ||
ffpe_artifact: "($ffpe_subst) & tumor:]0.0,0.05[" | ||
ffpe_artifact: "normal:0.0 & (($ffpe_subst) & tumor:]0.0,0.05[)" | ||
somatic_tumor_low: "normal:0.0 & ((($ffpe_subst) & tumor:]0.05,0.1[) | (!($ffpe_subst) & tumor:]0.0,0.1[))" | ||
?else: | ||
somatic_tumor_low: "normal:0.0 & tumor:]0.0,0.1[" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the brackets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of groups with just one entry
sample.loc["tumor", "sex"]
will just return sex as a string.But if there are multiple entries for a group sex will become a series.
In the previous implementation rendering the scenario only worked for groups with a single entry.
Changing sex to
sample.loc[["tumor"], "sex"]
will always return a series allowing to render single and multiple entries correctly.Edit: In your other comment you mentioned that each alias should only occur once. So if we handle multiple panels by prefix this change probably also becomes unnecessary.