# HG changeset patch # User iuc # Date 1631257140 0 # Node ID 6cc65a11d922eda5c31e9f34f1a3f74e2d2c05e0 # Parent ec5a925141137dd2acba012a8046e692b5b1b034 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/fsd commit db742c73b55c12a5ac5a11e6be3995670547bbb0" diff -r ec5a92514113 -r 6cc65a11d922 fsd_beforevsafter.py --- a/fsd_beforevsafter.py Wed Dec 04 16:32:40 2019 -0500 +++ b/fsd_beforevsafter.py Fri Sep 10 06:59:00 2021 +0000 @@ -13,6 +13,7 @@ # --output_tabular outputfile_name_tabular --output_pdf outputfile_name_pdf import argparse +import os.path import sys from collections import Counter @@ -164,7 +165,10 @@ # data of tags aligned to reference genome if ref_genome is not None: - pysam.index(ref_genome) + ref_genome_index = f"{ref_genome}.bai" + if not os.path.exists(ref_genome_index): + print(f"Info: Generating BAM index in {ref_genome_index}") + pysam.index(ref_genome) bam = pysam.AlignmentFile(ref_genome, "rb") seq_mut = [] for read in bam.fetch(): diff -r ec5a92514113 -r 6cc65a11d922 fsd_beforevsafter.xml --- a/fsd_beforevsafter.xml Wed Dec 04 16:32:40 2019 -0500 +++ b/fsd_beforevsafter.xml Fri Sep 10 06:59:00 2021 +0000 @@ -8,7 +8,11 @@ biopython pysam - + + ]]> diff -r ec5a92514113 -r 6cc65a11d922 fsd_regions.py --- a/fsd_regions.py Wed Dec 04 16:32:40 2019 -0500 +++ b/fsd_regions.py Fri Sep 10 06:59:00 2021 +0000 @@ -17,6 +17,7 @@ import argparse import collections +import os.path import re import sys @@ -61,7 +62,10 @@ with open(title_file2, "w") as output_file, PdfPages(title_file) as pdf: data_array = readFileReferenceFree(firstFile, "\t") - pysam.index(bamFile) + bamIndex = f"{bamFile}.bai" + if not os.path.exists(bamIndex): + print(f"Info: Generating BAM index in {bamIndex}") + pysam.index(bamFile) bam = pysam.AlignmentFile(bamFile, "rb") qname_dict = collections.OrderedDict() diff -r ec5a92514113 -r 6cc65a11d922 fsd_regions.xml --- a/fsd_regions.xml Wed Dec 04 16:32:40 2019 -0500 +++ b/fsd_regions.xml Fri Sep 10 06:59:00 2021 +0000 @@ -7,17 +7,19 @@ pysam - + + ]]>