Skip to content

Instantly share code, notes, and snippets.

View raonyguimaraes's full-sized avatar

Raony Guimaraes raonyguimaraes

View GitHub Profile
@raonyguimaraes
raonyguimaraes / exemplo.fasta
Created May 2, 2012 17:22
Read groups and fasta file using Biopython
>orf19.2163 orf19.2163 CGDID:CAL0005388 COORDS:Ca21chr6_C_albicans_SC5314:1028818-1031331W Exon(s) only sequence (2514 nucleotides) Uncharacterized ORF; Ortholog(s) have cytosol localization
MLEEEVHDTSSEASEVFTNQPNAFVRGVRSIFGYRKTSLTLFVILTIVVTAGLSFYDNSL
ELTIELPTSQLEKEILESSWLDLQNIARYPHTYGSRANDQVHDYLEEIIQDMEYDNDGEK
IMFELGKGVVSYYESNNLLVRVNGSDGTLPALLLSAHYDSVPSSFGVTDDGMGVASLLGV
LRFVAHNQPRRTIIFNFNNNEEFGLFGAHAFVKHPWFKQVGYFLNLEGTGAGGKAVLFRG
TDYGIVKNFGGVRYPYATSIFQQGFNNHVIHSETDYKVYKEAGLRGLDLAFYKPRDKYHT
GEDNIRNVSPKSLWHMMSNAIDFVQMGVVDDSEEPAVYTTFLGYFFATPISALARVNLVL
LVLFPVVSTPLLFVIVKYKKWKLRVTNFLGVPLAMGLAVAVGQVGNPMLVSSHPMMVVAT
TTSIVVLVYYVVLNGVDWVNTSSDQKLVTMIEVSFVYWVVLVYVTWSGGDHTGEFGVTVL
FFVQASTSLLGLIGWTFTRVRGGDEPLLSGEEERYGTEDERDTEKPLVEHNYDWSLQYLL
@raonyguimaraes
raonyguimaraes / get_genotypes.py
Created November 3, 2012 01:51 — forked from dalloliogm/get_genotypes.py
get genotypes from 1000genomes
#!/usr/bin/env python
"""
Given a file containing a table of genes and their coordinates (see "Inputs"), get their genotypes from 1000genomes.
This in reality is a wrapper to tabix. You need to have tabix installed in the .bin folder, and you also need to have a ./data/tabix_indexes folder on your file system.
Usage
=========
$: python get_genotypes.py -l data/n-glycan.coords
cd ~/webapps/app_name/
./apache2/bin/stop
rm -rf lib/python2.7/{D,d}jango* myproject*
PYTHONPATH=$PWD/lib/python2.7 easy_install-2.7 -s $PWD/bin -d $PWD/lib/python2.7 zc.buildout
wget http://pypi.python.org/packages/source/d/django-lfs/django-lfs-installer-0.6.0b5.tar.gz
tar zxf django-lfs-installer-0.6.0b5.tar.gz
cd lfs-installer/
python2.7 bootstrap.py
./bin/buildout -v # this will take a while to run and produce a lot of output, so be patient
sed -i "s/'ENGINE': 'django.db.backends.'/'ENGINE': 'django.db.backends.postgresql_psycopg2'/g" lfs_project/settings.py
cd ~/webapps/app_name/
./apache2/bin/stop
rm -rf lib/python2.7/{D,d}jango* myproject*
PYTHONPATH=$PWD/lib/python2.7 easy_install-2.7 -s $PWD/bin -d $PWD/lib/python2.7 zc.buildout
wget https://pypi.python.org/packages/source/d/django-lfs/django-lfs-installer-0.7.7.tar.gz#md5=1e1c20a51e5bea9a26c2177a07c5de19 --no-check-certificate
tar zxf django-lfs-installer-0.7.7.tar.gz
cd lfs-installer/
python2.7 bootstrap.py
./bin/buildout -v # this will take a while to run and produce a lot of output, so be patient
#configure database now
@raonyguimaraes
raonyguimaraes / gist:8227405
Created January 2, 2014 21:37
I want to know how I can use try:Tiny and txn_do inside a catalyst action. Can you help me ?
sub foo :Local :Args(1) {
my ( $self, $c, $item_id) = @_;
my $exception;
try {
$c->model('NetworkDB')->txn_do(sub {
foreach my $media_id (@media_array){
my $exam_question_media_up = $c->model('NetworkDB::ExamQuestionMedia')->search({exam_question_media_id => $media_id})->first();
$exam_question_media_up->update({
sequence=>$sequence_count;
@raonyguimaraes
raonyguimaraes / vcf_sample_file
Last active August 29, 2015 14:05
vcf_sample (roh problem)
##fileformat=VCFv4.1
##ApplyRecalibration="analysis_type=ApplyRecalibration input_file=[] sample_metadata=[] read_buffer_size=null phone_home=STANDARD read_filter=[] intervals=null excludeIntervals=null reference_sequence=/hpf/ngs_analysesb/genomes/index/bfast+bwa/hg19-cs50-2d/hg19.fa rodBind=[/hpf/ngs_analyses/work/llau/brazil/samples//Exome_3_EDS-20120504102632-gatk1.1.28f-hg19/gatk-raw-variants/Exome_3_EDS.raw.snps.vcf] rodToIntervalTrackName=null BTI_merge_rule=UNION nonDeterministicRandomSeed=false DBSNP=null downsampling_type=null downsample_to_fraction=null downsample_to_coverage=null baq=OFF baqGapOpenPenalty=40.0 performanceLog=null useOriginalQualities=false defaultBaseQualities=-1 validation_strictness=SILENT unsafe=null num_threads=1 interval_merging=ALL read_group_black_list=null processingTracker=null restartProcessingTracker=false processingTrackerStatusFile=null processingTrackerID=-1 allow_intervals_with_unindexed_bam=false disable_experimental_low_memory_sharding=false logging_level=INFO log
"""
Disable registration/signup
"""
#models.py
from allauth.account.adapter import DefaultAccountAdapter
class MyAccountAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
return False
blastoutput = "../input/R_2013_11_30_15_23_49_user_CTL-148-Metagenoma_Mauro_Eduardo2.CTLT_PGM.IonXpress_001_Q20_TrimRL_AT_80pb_cdhit97.all.blast_output"
from subprocess import call
#http://biopython.org/DIST/docs/api/Bio.SearchIO.BlastIO-module.html
from Bio import SearchIO
blast_results = SearchIO.parse(blastoutput, 'blast-text')
from Bio import SeqIO
merged_rec = ''
infile = "multi-rec.gbk"
for rec in SeqIO.parse(open(infile,"r"), "genbank") :
merged_rec += rec
# you could insert a spacer if needed
# merged_rec += rec + ("N" * 50)
#arquivo media.py
class Movie():
def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube):
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = poster_image
self.trailer_youtube_url = trailer_youtube
#arquivo entertainment_center.py
import media