Skip to content

Instantly share code, notes, and snippets.

@freesci
freesci / gist:5240374
Created March 25, 2013 20:24
Creating an annotation database in Bioconductor for non-model organism
source("http://bioconductor.org/biocLite.R")
library(AnnotationForge)
makeOrgPackageFromNCBI(version="0.0.1",author="PS",maintainer="PS <ps@pawelszczesny.org>",outputDir=".",tax_id=4081,genus="Solanum", species="lycopersicum")
#here you need to wait a bit, few hours maybe
install.packages("org.Slycopersicum.eg.db", repos=NULL, type="source")
library("org.Slycopersicum.eg.db/")
keys<-head(keys(org.Slycopersicum.eg.db))
head(select(org.Slycopersicum.eg.db, keys=keys,cols=c("ENTREZID","ACCNUM","ALIAS","CHR","PMID","REFSEQ","SYMBOL","UNIGENE" ,"GENENAME"))
@freesci
freesci / consensus_from_mapping
Created March 25, 2013 14:48
Create consensus sequences from mapping reads onto multifasta reference. For background see: http://www.biostars.org/p/65903/
bwa index database.fasta
bwa aln -t #num_threads database.fasta reads.fastq > reads.sai
bwa samse database.fasta reads.sai reads.fastq > aln.sam
samtools view -b -o aln.bam aln.sam
samtools sort aln.bam aln.sorted
samtools index aln.sorted.bam
samtools mpileup -uf database.fasta aln.sorted.bam |bcftools view -cg - |vcfutils.pl vcf2fq >aln.fastq