Skip to content

Commit

Permalink
add extract_subpop script (#7387)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsasch authored Aug 3, 2021
1 parent 67f61b7 commit e9e0451
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .dockstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ workflows:
- ah_var_store
- name: GvsValidateVatTable
subclass: WDL
primaryDescriptorPath: /scripts/variantstore/wdl/GvsValidateVAT.wdl
primaryDescriptorPath: /scripts/variantstore/variant_annotations_table/GvsValidateVAT.wdl
filters:
branches:
- ah_var_store
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions scripts/variantstore/wdl/extract/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install bcftools
# Add the application source code.
ADD create_cohort_extract_data_table.py /app
ADD create_variant_annotation_table.py /app
ADD extract_subpop.py /app

WORKDIR /app
ENTRYPOINT ["/bin/bash"]
22 changes: 22 additions & 0 deletions scripts/variantstore/wdl/extract/extract_subpop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import csv
import argparse

def extract_subpopulation(input_path, output_path):
with open(input_path, newline='') as tsvin, open(output_path, 'w', newline='') as csvout:
tsvin = csv.reader(tsvin, delimiter='\t')
csvout = csv.writer(csvout, delimiter='\t')

for row in tsvin:
csvout.writerow([row[0], row[4]])


if __name__ == '__main__':
parser = argparse.ArgumentParser(allow_abbrev=False, description='Extract subpopulation per sample data out of a callset TSV')
parser.add_argument('--input_path',type=str, metavar='path', help='path to the original callset TSV', required=True)
parser.add_argument('--output_path',type=str, metavar='path', help='path for the output TSV', required=True)

args = parser.parse_args()

extract_subpopulation(args.input_path,
args.output_path)

0 comments on commit e9e0451

Please sign in to comment.