This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import os | |
import sys | |
import argparse | |
import screed | |
def make_outdir(output_dirname): | |
if not os.path.exists(output_dirname): | |
try: | |
os.makedirs(output_dirname) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import argparse | |
import glob | |
from shutil import copyfile | |
# requires python >= 3.6 | |
# run: python copy_samplefiles.py haptophyta.txt --source ../../pep/ --destination ../../haptophyta_pep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Author: Tessa Pierce | |
import argparse | |
import screed | |
import re | |
def extract_contigs(in_fasta, pattern, outF): | |
if not outF: | |
outF = in_fasta.split('.fa')[0] + '_' + pattern + '.fa' | |
with screed.open(in_fasta) as seqF: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from snakemake.remote import FTP | |
FTP = FTP.RemoteProvider() | |
data_dir='data_subset' | |
targets = [] | |
with open('SRA_accessions.txt', 'r') as f: | |
for line in f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *fq.gz; do | |
echo 'starting on file' $f | |
cp "$f" "$f~" && | |
gzip -cd "$f~" | sed 's/^@ERR\S*\s/@/' | gzip > "$f" | |
rm "$f~" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################### | |
"""Function: Take in a dammit gff3, dammit fasta, dammit namemap. | |
Output gff3 and fasta with trinity names. | |
by Dr. Tessa Pierce | |
""" | |
################################################################### | |
import sys | |
import os | |
import argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import argparse | |
import screed | |
def generate_geneTransMap(fasta, geneTransMap, transGeneMap): | |
if transGeneMap: | |
outT = open(transGeneMap, "w") | |
with open(geneTransMap, "w") as outG: | |
with screed.open(fasta) as seqs: | |
for read in seqs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################### | |
"""Function: Take in a list of trinity gene names, a dammit namemap, | |
and a dammit fasta file. Output fasta of matching dammit contigs. | |
""" | |
################################################################### | |
import sys | |
import os | |
import argparse | |
import screed |