This file contains 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
def _index_bfast(ref_file): | |
"""Indexes bfast in color and nucleotide space for longer reads. | |
This preps for 40+bp sized reads, which is bfast's strength. | |
""" | |
dir_name = "bfast" | |
window_size = 14 | |
bfast_nt_masks = [ | |
"1111111111111111111111", | |
"1111101110111010100101011011111", |
This file contains 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
(use '[clojure.java.io]) | |
(use '[clojure.contrib.str-utils2 :only (join)]) | |
(defn fasta-lengths [in-file] | |
"Generate collection of FASTA record lengths, splitting at '>' delimiters" | |
(->> (line-seq (reader in-file)) | |
(partition-by #(.startsWith ^String % ">")) | |
(filter #(not (.startsWith ^String (first %) ">"))) | |
(map #(join "" %)) | |
(map #(.length ^String %)))) |
This file contains 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
with open ("dna.txt", "r") as myfile: | |
data=myfile.readlines() | |
mRNA=data[1] | |
def next_transcript(mRNA, cur_pos): | |
initial=mRNA.find("AUG", cur_pos) | |
for i in range(initial, len(mRNA),3): | |
if mRNA[i:i+3] == "UAG": | |
return initial, i |
This file contains 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
(comment " | |
Retrieve UniProt FASTA files for provided input identifiers using REST API. | |
http://www.uniprot.org/faq/28 | |
Usage: | |
cljr run fetch_uniprot_fasta.clj [Any number of Uniprot IDs] | |
") | |
(ns biostar.uniprot | |
(:import [java.net URLEncoder]) |
This file contains 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
"""Retrieve sequences from a MAF file for a genomic coordinate. | |
Usage: | |
maf_retrieve_region.py <maf file> <organism> <chromosome> <start> <end> | |
""" | |
import os | |
import sys | |
import subprocess | |
from bx.align import maf |
This file contains 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
from Bio import Entrez | |
def fetch_gene_coordinates(search_term): | |
handle = Entrez.esearch(db="gene", term=search_term) | |
rec = Entrez.read(handle) | |
gene_id = rec["IdList"][0] # assuming best match works | |
handle = Entrez.efetch(db="gene", id=gene_id, retmode="xml") | |
rec = Entrez.read(handle)[0] | |
gene_locus = rec["Entrezgene_locus"][0] |
This file contains 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
class ORFFinder: | |
"""Find the longest ORF in a given sequence | |
"seq" is a string, if "start" is not provided any codon can be the start of | |
and ORF. If muliple ORFs have the longest length the first one encountered | |
is printed | |
""" | |
def __init__(self, seq, start=[], stop=["TAG", "TAA", "TGA"]): | |
self.seq = seq | |
self.start = start | |
self.stop = stop |
This file contains 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
--- src/main/java/org/biojava3/core/sequence/transcription/RNAToAminoAcidTranslator.java.orig 2011-03-09 15:32:39.295875004 -0500 | |
+++ src/main/java/org/biojava3/core/sequence/transcription/RNAToAminoAcidTranslator.java 2011-03-10 08:18:42.525875009 -0500 | |
@@ -85,7 +85,6 @@ | |
codonL.add(codon); | |
} | |
- | |
unknownAminoAcidCompound = aminoAcids.getCompoundForString("X"); | |
} | |
This file contains 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
(ns distblast-cluster.vagrant | |
(:require [pallet.compute :as compute] | |
[pallet.phase :as phase] | |
[pallet.core :as core] | |
[pallet.utils :as utils] | |
[pallet.compute.node-list :as node-list] | |
[pallet.action.exec-script :as exec-script])) | |
(defn test-script [session] | |
(-> session |
This file contains 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
#!/bin/bash | |
#--- config | |
SERVICE_NAME=galaxy | |
RUN_AS=galaxy | |
RUN_IN=/your/galaxy/directory | |
#--- main actions |