Skip to content

Commit

Permalink
Merge pull request #5 from d3b-center/bug/fix-header-naming
Browse files Browse the repository at this point in the history
Fixing header bug: LOH
sakshamphul authored Apr 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 54ad300 + 6a4fb7c commit 1c63c11
Showing 2 changed files with 13 additions and 11 deletions.
16 changes: 9 additions & 7 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -25,23 +25,25 @@ optional arguments:

Tumor tool search in a paired tumor sample (example match to above germline) and, if given, parental germline samples, for the same variant and calculate the VAF and creates an output file with (BS_id, gene, chr, start, stop, ref/alt alleles, ref/alt allele depths, VAF) for each of: proband germline, proband tumor, paternal germline, maternal germline

(Optional) This tool has the ability to analyze LOH for trios too with multiple tumor samples.
(Optional) This tool has the ability to analyze LOH for trios samples with multiple tumor samples.

```
python3 run_readcount_parse.py --help
usage: run_readcount_parse.py [-h] [--tsv TSV] [--sampleid SAMPLEID] [--reference REFERENCE]
usage: run_readcount_parse.py [-h] [--tsv TSV] [--participant_id PARTICIPANTID]
[--reference REFERENCE]
[--patientbamcrams PATIENTBAMCRAMS [PATIENTBAMCRAMS ...]] [--list LIST] [--peddy PEDDY]
[--minDepth MINDEPTH] [--bamcramsampleID BAMCRAMSAMPLEID [BAMCRAMSAMPLEID ...]]
optional arguments:
Required arguments:
-h, --help show this help message and exit
--tsv TSV bcftool output file in tsv format
--sampleid SAMPLEID patient primary sampleid for this run
--reference REFERENCE
human reference
--participant_id PARTICIPANTID patient participant_id for this run
--reference REFERENCE Human reference
--list LIST path to directory containing regions created by germline run to consider in tumor
Optional arguments:
--patientbamcrams PATIENTBAMCRAMS [PATIENTBAMCRAMS ...]
provide one or more bam/cram file for patient tumor
--list LIST path to directory containing regions created by germline run to consider in tumor
--peddy PEDDY peddy file containing parental information
--minDepth MINDEPTH min tumor depth required to be consider for tumor output
--bamcramsampleID BAMCRAMSAMPLEID [BAMCRAMSAMPLEID ...]
8 changes: 4 additions & 4 deletions scripts/run_readcount_parse.py
Original file line number Diff line number Diff line change
@@ -69,13 +69,13 @@ def worker(region_list, bamcram, read_file_name, ID, headers):
list_data, columns=headers
) # convert to pandas with headers

target_header = "proband_" + ID + "_tumor_depth"
first_header = "proband_" + ID + "_tumor_ref_depth"
first_header = "proband_" + ID + "_tumor_depth"
target_header = "proband_" + ID + "_tumor_ref_depth"
second_header = "proband_" + ID + "_tumor_alt_depth"

df_readcount_thread[target_header] = df_readcount_thread[first_header].astype(
int
) + df_readcount_thread[second_header].astype(int)
) - df_readcount_thread[second_header].astype(int)
os.remove(read_file_name)

return df_readcount_thread
@@ -91,8 +91,8 @@ def parse_bam_readcout_data(bamcram, ID, path_lists):
"ref",
"alt",
"tumor_vaf",
"tumor_depth",
"tumor_alt_depth",
"tumor_ref_depth",
] # tumor headers

headers = [

0 comments on commit 1c63c11

Please sign in to comment.