Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make and making executable #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# Even if you never use these commands here, they provide a good example of ways to use the python
# scripts included in this project.

# --- put test first, so `make` runs this and exits
test:
python bin/test_requirements.py

#---------------Bio 496, Project ---------------

prot_and_dna: diamond_db bowtie2_index
Expand Down Expand Up @@ -119,9 +123,6 @@ protein_hits:



test:
python bin/test_requirements.py

demo: clean
#Download 100 sample reads
fastq-dump --outdir Input/SRA_datasets/ -X 100000 --skip-technical --readids --dumpbase --clip SRR3403834
Expand Down
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