changeset 7:2c6f630c732f draft

Uploaded
author jackcurragh
date Tue, 07 Jun 2022 16:49:36 +0000
parents 1be4bbe849e3
children 0fcffa7365b9
files trips_bam_to_sqlite/bam_to_sqlite.py trips_bam_to_sqlite/trips_bam_to_sqlite.xml
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/trips_bam_to_sqlite/bam_to_sqlite.py	Tue Jun 07 16:20:36 2022 +0000
+++ b/trips_bam_to_sqlite/bam_to_sqlite.py	Tue Jun 07 16:49:36 2022 +0000
@@ -288,8 +288,9 @@
     master_offset_dict = {"fiveprime": {}, "threeprime": {}}
     master_metagene_stop_dict = {"fiveprime": {}, "threeprime": {}}
 
+    os.system(f'samtools sort -n {bam_filepath} -o {bam_filepath}_n_sorted.bam')
     pysam.set_verbosity(0)
-    infile = pysam.Samfile(f"{bam_filepath}", "rb")
+    infile = pysam.Samfile(f"{bam_filepath}_n_sorted.bam", "rb")
     header = infile.header["HD"]
     unsorted = False
     if "SO" in header:
--- a/trips_bam_to_sqlite/trips_bam_to_sqlite.xml	Tue Jun 07 16:20:36 2022 +0000
+++ b/trips_bam_to_sqlite/trips_bam_to_sqlite.xml	Tue Jun 07 16:49:36 2022 +0000
@@ -1,9 +1,10 @@
-<tool id="bam_to_sqlite" name="BAM to Sqlite" version="1.2">
+<tool id="bam_to_sqlite" name="BAM to Sqlite" version="1.3">
     <description>Convert BAM file to SQLITE for Trips-Viz</description>
     <requirements>
         <requirement type="package" version="0.19.0">pysam</requirement>
         <requirement type="package" version="1.7.0">sqlitedict</requirement>
         <requirement type="package" version="3.37.1">sqlite</requirement>
+        <requirement type="package" version="1.13">samtools</requirement>
 
     </requirements>
     <command><![CDATA[