Skip to content

Instantly share code, notes, and snippets.

View fomightez's full-sized avatar

Wayne's Bioinformatics Code Portal fomightez

View GitHub Profile
@fomightez
fomightez / get accession numbers regex.md
Last active August 29, 2015 14:07
get list of just accession numbers from fasta sequence entries list using regular expressions
@fomightez
fomightez / test_table.md
Last active August 29, 2015 14:08
test_table
Left-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1
col 3 is some wordy text $1600
col 2 is centered $12
@fomightez
fomightez / ELink_keeping_order.py
Last active August 29, 2015 14:10
ELink use keeping order of output uids same as input order
@fomightez
fomightez / mRNAforProtein.py
Last active August 29, 2015 14:11
Retrieve mRNA Seq from NCBI Given A List Of Protein Accessions
#script to accompany https://www.biostars.org/p/64078/
from Bio import Entrez
Entrez.email = "A.N.Other@example.com"
protein_accn_numbers = ["ABR17211.1", "XP_002864745.1", "AAT45004.1", "XP_003642916.1" ]
protein_gi_numbers = []
print "The Accession numbers for protein sequence provided:"
print protein_accn_numbers
@fomightez
fomightez / DNA_to_RNAsimple.py
Created January 14, 2015 04:39
basic version of DNA FASTA records converted to RNA, see https://github.com/fomightez/sequencework/blob/master/ConvertSeq/ConvertFASTAdnaSEQtoRNA.py for a fancier version
#! /usr/bin/env python
# DNA_to_RNA.py
# basic version of DNA FASTA records converted to RNA, see https://github.com/fomightez/sequencework/blob/master/ConvertSeq/ConvertFASTAdnaSEQtoRNA.py for a fancier version
# adapted from start and end of latlon_3.py - from Chapter 10 PCfB
# Read in each line of the example file
# Set the input file name
import random
numbers = range (1,50)
chosen = []
while len(chosen) < 6:
number = random.choice(numbers)
numbers.remove(number)
chosen.append(number)
@fomightez
fomightez / fasta_example
Created January 15, 2015 16:00
example of some fasta records in a file
>gi|429243135|ref|NM_001019799.2| Schizosaccharomyces pombe 972h- ribonuclease MRP complex subunit (predicted) (SPAC323.08), mRNA
TGTTCACATTGCTCACTCGTTGGGTGGTTTGTACGACCTATTTGTCTAGTCCAACGATATGCAGGAATTG
CAATACGATGTAGTTTTATTGCAAAAAATCGTGTATAGGAATAGAAATCAGCATCGACTAAGTGTTTGGT
GGAGACACGTACGAATGCTGCTTCGAAGACTAAAGCAGTCGCTAGATGGAAATGAAAAAGCGAAAATTGC
TATTTTAGAACAATTGCCGAAATCGTACTTTTATTTTACAAACTTAATTGCCCATGGTCAGTATCCAGCC
TTAGGGTTAGTTTTGCTGGGTATCTTAGCTCGCGTTTGGTTTGTTATGGGCGGAATAGAGTACGAAGCAA
AAATACAATCGGAAATAGTCTTTAGTCAAAAGGAGCAAAAAAAATTGGAATTACAGTCTCAAGATGACAT
AGACACTGGGACTGTTGTAGCTCGCGATGAATTGCTAGCTACGGAACCTATTTCATTGTCTATAAATCCT
GCTTCTACTAGTTATGAGAAACTGACTGTATCCTCTCCTAATTCTTTTCTCAAGAATCAAGATGAATCTC
TCTTCTTGTCTTCTTCTCCTATAACTGTTTCTCAAGGTACCAAACGTAAATCCAAAAACTCAAATTCCAC
@fomightez
fomightez / mutation_data.bed
Created January 15, 2015 18:52
for python demo
chr1 21394 21394 A G
chr2 94116 94116 A G
chr3 41121 41121 T C
chr4 22139 22139 A G
chr5 181396 181396 G A
chr7 347119 347119 A G
chr8 99196 99196 A G
chr10 194236 194236 C G
@fomightez
fomightez / Using SimpleHTTPServer on Mac to run JSmol locally.md
Last active August 29, 2015 14:15
Using SimpleHTTPServer on Mac to run JSmol locally

##Using SimpleHTTPServer to run JSmol locally with Chrome

adapted from Nelson Liu's post to Jmol Users' list Tue, 17 Feb 2015. It will work out of the box on both Mac and Linux machines. Windows will need Python installed and a terminal emulator (UNTESTED!!). Doesn't matter if you are already running Chrome; I didn't have luck with open -a /Applications/Google\ Chrome.app/ --args --allow-file-access-from-files when I already had Chrome running.

  • Skip the first three steps if you already downloaded Jmol, unpacked it, and unpacked jsmol.zip.

  • Download Jmol binary.

  • Unpack binary.

@fomightez
fomightez / regex_for_SGD_fasta.md
Last active August 29, 2015 14:17
regular expression to replace description lines in fasta from SGD with simple 'chr' followed by number or mt

REGEX for replacing SGD fasta description line with chromosome number

recreating steps probably used in process described in ChIP-Seq example at NUCwave site

S. cerevisiae reference genome was downloaded from SGD and FASTA headers for chromosome names were replaced with chrI-chrXVI.