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
import sys | |
sys.path.append('/bioware/pythonmodules/fastalib/') | |
import fastalib as u | |
fasta = u.SequenceSource(sys.argv[1]) | |
output = u.FastaOutput(sys.argv[1] + '-with-gaps') | |
longest_read = 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
import sys | |
import Oligotyping.lib.fastalib as u | |
fasta = u.SequenceSource(sys.argv[1]) | |
output = u.FastaOutput(sys.argv[1] + '-QIIME-READY') | |
# H12DL4_12 B022DACXX4110133892403 orig_bc=GATCAG new_bc=GATCAG bc_diffs=0 | |
sample_read_counter = {} |
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
# coding: utf-8 | |
import sys | |
from Oligotyping.utils.utils import generate_ENVIRONMENT_file | |
from Oligotyping.utils.utils import get_oligos_sorted_by_abundance | |
from Oligotyping.utils.utils import get_unit_counts_and_percents | |
from Oligotyping.utils.utils import generate_MATRIX_files | |
from Oligotyping.utils.utils import get_filtered_samples_dict | |
from Oligotyping.utils.utils import get_samples_dict_from_environment_file |
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
##################################################################################### | |
# Q-Q plot in ggplot2 | |
# taken from http://stackoverflow.com/questions/4357031/qqnorm-and-qqline-in-ggplot2 | |
##################################################################################### | |
require(ggplot2) | |
vec <- Hg$AMT # whateer | |
y <- quantile(vec[!is.na(vec)], c(0.25, 0.75)) |
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
# sorry about the terrible code. example use: | |
# | |
# python expand_regex_pattern.py A.T[C,T]AAA.[A,G]AAT[A,T]GACGG | |
# | |
import sys | |
rp = sys.argv[1] | |
expant = [''] | |
valid_bases = ['A', 'T', 'C', 'G'] |
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
# example fasta defline: | |
#>147406386-BM_GFKBOSR02F10DX|Bacteria;Actinobacteria;Actinobacteria;Actinomycetales;Micrococcaceae;Rothia | |
import sys | |
import Oligotyping.lib.fastalib as u | |
from Oligotyping.utils.utils import generate_ENVIRONMENT_file | |
from Oligotyping.utils.utils import get_sample_name_from_defline | |
from Oligotyping.utils.utils import get_oligos_sorted_by_abundance | |
from Oligotyping.utils.utils import get_unit_counts_and_percents | |
from Oligotyping.utils.utils import generate_MATRIX_files |
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
meren ~/tmp/sample-run $ ls mock-env-aligned-c2-s1-a1.0-A0-M0/ | |
COLORS MATRIX-PERCENT.txt OLIGOS.nexus | |
ENVIRONMENT.txt NETWORK.gexf READ-DISTRIBUTION.txt | |
FIGURES/ OLIGO-REPRESENTATIVES/ RUNINFO | |
FIGURES.cPickle OLIGO-REPRESENTATIVES.fasta RUNINFO.cPickle | |
MATRIX-COUNT.txt OLIGOS.fasta RUNINFO.log |
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
library('ape') | |
library('vegan') | |
library('ade4') | |
raw_data <- t(data.matrix(read.table('YOUR TAB DELIMITED TRANSCRIPTOMIC DATA MATRIX', header = TRUE, row.names = 1, sep="\t"))) | |
drows<-vegdist(t(raw_data), method='euclidean', na.rm=TRUE) | |
hc <- hclust(drows, method='ward') | |
phy <- hclust2phylog(hc, add.tools = TRUE) |
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
import sys | |
import IlluminaUtils.lib.fastqlib as u | |
import IlluminaUtils.lib.fastalib as f | |
from IlluminaUtils.utils.helperfunctions import reverse_complement | |
# call this script like this: | |
# | |
# python demultiplex.py barcode_to_sample_name_file index_fastq_file quality_filtered_fasta_file | |
# | |
# expected file formats are shown below. |
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
library(ggplot2) | |
library(maps) | |
require(ggmap) | |
library(vegan) | |
require(mapproj) | |
library(maptools) | |
####################################################################################################################### | |
####################################################################################################################### | |
# |