Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
hopedisastro committed Aug 21, 2023
1 parent 0d4e15b commit 1aa9e0b
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions str/trtools/merge_str_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,31 @@ def main(
# Initializing Batch
b = get_batch()

#Initialise TRTools job to run mergeSTR
# Initialise TRTools job to run mergeSTR
trtools_job = b.new_job(name='mergeSTR')
trtools_job.image(TRTOOLS_IMAGE)
trtools_job.cpu(8)
#mount using cloudfuse for reading input files
# mount using cloudfuse for reading input files
trtools_job.cloudfuse(f'cpg-{dataset}-main-analysis', '/vcffuse')
trtools_job.declare_resource_group(
vcf_output={
'vcf': '{root}.vcf'
}
)

#Initialise job to zip and index the mergeSTR VCF prior to writing to output
zip_job = b.new_job(name = 'Zip and index')
trtools_job.declare_resource_group(vcf_output={'vcf': '{root}.vcf'})

# Initialise job to zip and index the mergeSTR VCF prior to writing to output
zip_job = b.new_job(name='Zip and index')
zip_job.image(TRTOOLS_IMAGE)
zip_job.cpu(8)
zip_job.declare_resource_group(
vcf_output={
'vcf.gz':'{root}.vcf.gz',
'vcf.gz.tbi':'{root}.vcf.gz.tbi'
}
)


#read in input file paths
vcf_output={'vcf.gz': '{root}.vcf.gz', 'vcf.gz.tbi': '{root}.vcf.gz.tbi'}
)

# read in input file paths
vcffuse_path = []
for id in list(internal_wgs_ids):
vcf = os.path.join(input_dir, f'{id}_eh.reheader.vcf.gz')
suffix = vcf.removeprefix('gs://').split('/', maxsplit=1)[1]
vcffuse_path.append(f'/vcffuse/{suffix}')
num_samples = len(vcffuse_path)
vcffuse_path = ','.join(vcffuse_path) # string format for input into mergeSTR

trtools_job.command(
f"""
mergeSTR --vcfs {vcffuse_path} --out {trtools_job.vcf_output} --vcftype eh
Expand All @@ -87,11 +79,9 @@ def main(

output_path_name = output_path(f'mergeSTR_{num_samples}_samples_eh', 'analysis')
b.write_output(zip_job.vcf_output, output_path_name)

b.run(wait=False)


if __name__ == '__main__':
main() # pylint: disable=no-value-for-parameter



0 comments on commit 1aa9e0b

Please sign in to comment.