Skip to content

Commit

Permalink
Convert the scripts to executables. This closes KyleLevi#2
Browse files Browse the repository at this point in the history
  • Loading branch information
linsalrob committed Jan 23, 2020
1 parent f2f711b commit 0c9713d
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 7 deletions.
2 changes: 2 additions & 0 deletions bin/bam_stats.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import argparse
import pysam
import os
Expand Down
2 changes: 2 additions & 0 deletions bin/conserved_regions_csv.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3'

import os
import sys
import argparse
Expand Down
4 changes: 3 additions & 1 deletion bin/coverage_depth_csv.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import argparse
import os
Expand Down Expand Up @@ -92,4 +94,4 @@ def condense_list(big_list, condense_size=100):
outfile.write(','.join(x) + '\n')
with open(args.output + '.row_labels.txt', 'a') as outfile:
outfile.write(args.output + '\n')
sys.exit(0)
sys.exit(0)
2 changes: 2 additions & 0 deletions bin/csv_to_heatmap.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import numpy as np
from numpy import vstack # VSTACK((a,b)) stacks B on TOP of A
import seaborn as sns; sns.set()
Expand Down
2 changes: 2 additions & 0 deletions bin/genome_coverage.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import pysam
import argparse
Expand Down
4 changes: 3 additions & 1 deletion bin/hits_by_organism.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import os
import argparse
import sys
Expand Down Expand Up @@ -30,4 +32,4 @@
organisms[line[1]] = organisms.get(line[1], 0) + int(line[2])
with open(args.output, 'w') as outfile:
for k in sorted(organisms, key=organisms.get, reverse=True):
outfile.write(delim.join([str(k),str(organisms[k])]) + '\n')
outfile.write(delim.join([str(k),str(organisms[k])]) + '\n')
2 changes: 2 additions & 0 deletions bin/m8_hits.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand Down
2 changes: 2 additions & 0 deletions bin/m8_reader.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

"""
M8_Reader! This package is designed to read .m8 files produced by diamond blastx, specifically with a command
to include the actual DNA sequence matched to the protein. This information is not provided by default when using
Expand Down
4 changes: 3 additions & 1 deletion bin/m8_stats.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand Down Expand Up @@ -37,4 +39,4 @@
line = [str(x) for x in line]
outfile.write('\t'.join(line))
outfile.write('\n')
outfile.close()
outfile.close()
2 changes: 2 additions & 0 deletions bin/pbs_aggregator.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand Down
4 changes: 3 additions & 1 deletion bin/rapsearch_fastq_fixer.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import os
import sys
import argparse
Expand Down Expand Up @@ -45,4 +47,4 @@
ret_code = subprocess.call(mv_command)
if ret_code != 0:
sys.stderr.write("Error running command \"{}\"\n".format(' '.join(mv_command)))
sys.exit(1)
sys.exit(1)
2 changes: 2 additions & 0 deletions bin/remove_short_reads.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand Down
4 changes: 3 additions & 1 deletion bin/sam_hits.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand All @@ -16,4 +18,4 @@
sys.exit(1)

samfiles = Sam_Reader(args.input)
samfiles.hits(write_file=args.output)
samfiles.hits(write_file=args.output)
2 changes: 2 additions & 0 deletions bin/sam_stats.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand Down
4 changes: 3 additions & 1 deletion bin/single_pbs.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import os
import argparse
Expand All @@ -17,4 +19,4 @@
sys.exit(1)

data = Sam_Reader(args.input)
data.per_base_stats(write_file=args.output)
data.per_base_stats(write_file=args.output)
4 changes: 3 additions & 1 deletion bin/split_bam.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import argparse
import pysam
Expand Down Expand Up @@ -87,4 +89,4 @@ def split_sam(infile, minimum_match_length, out_directory):
if not args.length:
args.length = 0

split_sam(args.input, args.length, args.output)
split_sam(args.input, args.length, args.output)
2 changes: 2 additions & 0 deletions bin/target_sites.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import argparse
import sys
import operator
Expand Down
2 changes: 2 additions & 0 deletions bin/test_requirements.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import sys
import subprocess

Expand Down
2 changes: 2 additions & 0 deletions bin/xml_scrape.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import os
import sys
import argparse
Expand Down

0 comments on commit 0c9713d

Please sign in to comment.