Tag Archives: ipython

Analyzing fastq files

  • Created another iPython notebook ‘BSMAP-v1′
  • Used program bsmp-2.74 to compare the files with template genome to observe the methylation pattern.

-a is query file

-d is reference sequence file (In ‘halfshell’ on OWL)

-o is output alignment file (Saved in ‘analyses’ folder in ‘Mrunmayee’ (OWL server))

  • Others used for creating methratio_out_{i}_b.txt files:

-u = report unmapped reads

-z = base quality

-g = gap size

-s = seed size

  • Also used for loop to go through files and count the number of lines to make sure that there is no glitch
  • cd.. = switches directory to one above
  • = next line
  • Useful code is in SR github: LabDocs/code/bash.md
Share

iframes for IPython

This will demonstrate the use of iframes and nbviewer to embed IPython notebooks in WordPress. For an example that should work in most cases, enter syntax equivalent to this into the Text tab of the WordPress editor:

[iframe src="http://nbviewer.ipython.org/urls/dl.dropbox.com/s/zwyp2nuue76nuwy/Amanda%20-%20Seastar%20Transcriptome%20continued%20continued.ipynb" width="100%" same_height_as="window" scrolling="yes"]

which will render from IPython as in the example shown below, an implementation of the syntax above. Following this example are additional parameters you can use to modify the appearance and function of an iframe in the Open Notebook Science Network.

iframe parameters and defaults:

  • src – source of the iframe [iframe src="https://www.youtube.com/watch?v=bGsKfEKVLdI&list=PL18515FB92008FA97"] (by default src=”https://www.youtube.com/watch?v=bGsKfEKVLdI&list=PL18515FB92008FA97″);
  • width – width in pixels or percentage [iframe width="100%" src="https://www.youtube.com/watch?v=bGsKfEKVLdI&list=PL18515FB92008FA97"] or [iframe width="640" src="https://www.youtube.com/watch?v=bGsKfEKVLdI&list=PL18515FB92008FA97"] (by default width=”100%”);
  • height – height in pixels [iframe height="480" src="https://www.youtube.com/watch?v=bGsKfEKVLdI&list=PL18515FB92008FA97"] (by default height=”480″);
  • scrolling – parameter [iframe scrolling="yes"] (by default scrolling=”no”);
  • frameborder – parameter [iframe frameborder="0"] (by default frameborder=”0″);
  • marginheight – parameter [iframe marginheight="0"] (removed by default);
  • marginwidth – parameter [iframe marginwidth="0"] (removed by default);
  • allowtransparency – allows to set transparency of the iframe [iframe allowtransparency="true"] (removed by default);
  • id – allows to add the id of the iframe [iframe id="my-id"] (removed by default);
  • class – allows to add the class of the iframe [iframe class="my-class"] (by default class=”iframe-class”);
  • style – allows to add css styles of the iframe [iframe style="margin-left:-30px;"] (removed by default);
  • same_height_as – allows to set the height of iframe same as target element [iframe same_height_as="body"], [iframe same_height_as="div.sidebar"], [iframe same_height_as="div#content"], [iframe same_height_as="window"] – iframe will have the height of the viewport (visible area), [iframe same_height_as="document"] – iframe will have the height of the document, [iframe same_height_as="content"] – auto-height feature, so the height of the iframe will be the same as embedded content. [[same_height_as="content"]] works only with the same domain and subdomain. Will not work if you want to embed page “sub.site.com” on page “site.com”. (removed by default);
  • get_params_from_url – allows to add GET parameters from url to the src of iframe; Example: page url – site.com/?prm1=11, shortcode – [iframe src="embed.com" get_params_from_url="1"], iframe src – embed.com?prm1=11 (disabled by default);
  • any_other_param – allows to add new parameter of the iframe [iframe any_other_param="any_value"];
  • any_other_empty_param – allows to add new empty parameter of the iframe (like “allowfullscreen” on YouTube) [iframe any_other_empty_param=""];

Note that while this is ability is enabled here in the Open Notebook Science Network, it is not enabled in all WordPress sites and networks hosted by the Open Science Federation, nor is it enabled in most other WordPress sites, including WordPress.com, for security reasons.

This network is moderated and optimised for Open Notebook Science. Embedding from an IPython notebook is one of many features for Open Science, others including licensing management for media, integration with Zotero for reference management, syntax highlighting, MathJax-LaTeX, etc.

Share

Annotation 101

DIRECT LINK to nbviewer

http://nbviewer.ipython.org/github/sr320/eimd/blob/master/ipynbs/c_Annotation.ipynb


 

Annotation (Blast)

In [1]:
#Contigs from Assembly
!head /Volumes/web/cnidarian/SeaStar_transc_v2.fa
>3291_5903_10007_H94MGADXX_V_CF71_ATCACG_R1_(paired)_trimmed_(paired)_contig_1

CAAATATATGAACGGTTGATTGTCAACGATTAGTACATGTTTTCATTGTTCCCCACGCCC

GCCCCCCCCCACTCAAACATTTAAAGTGTGAAATATTATTTATCCACAAATTTCCTTAAA

CCTGCAAACTTGTCTGCTGTCTCTTATTGGAAGTTATGAAAAAGAACAACGGGTTTTCTT

TAAAGGGTCTGCGTGCGATTTTCAACCTTTTGAGTAATAGCAGTTATTTTGATAACCGAT

TTTTTTCAAAGCTCAACAGCTTTTTAAAATAAGGAATCCTATAATGGCCAAACGAATACT

ATAAAAATAAGGGTTCTCTTAATTGTATAAAACGTATAATTTTATCAATTTTGGGACCGT

GTAATTTTTTAAAGACCACAAGAATGTTACATACAACAAATAGACGAAACTCGTAGCTTT

GGAAACTACGTCATGGGCGTTTGGTCAAAAGCTGGAGAGAAAGAGAGGTGGGGTGCCAGA

CTTAAGTAGTCACGTGATCTGACCAACGCACATCGGAAGCTCGATCGGATGAAATCTTCT


In [2]:
#Making the query look better
!sed 's/3291_5903_10007_H94MGADXX_V_CF71_ATCACG_R1_(paired)_trimmed_(paired)/Phel_clc/g' </Volumes/web/cnidarian/SeaStar_transc_v2.fa> /Users/sr320/Dropbox/Steven/eimd/data/Phel_transcriptome_clc.fa
In [3]:
!head /Users/sr320/Dropbox/Steven/eimd/data/Phel_transcriptome_clc.fa
>Phel_clc_contig_1

CAAATATATGAACGGTTGATTGTCAACGATTAGTACATGTTTTCATTGTTCCCCACGCCC

GCCCCCCCCCACTCAAACATTTAAAGTGTGAAATATTATTTATCCACAAATTTCCTTAAA

CCTGCAAACTTGTCTGCTGTCTCTTATTGGAAGTTATGAAAAAGAACAACGGGTTTTCTT

TAAAGGGTCTGCGTGCGATTTTCAACCTTTTGAGTAATAGCAGTTATTTTGATAACCGAT

TTTTTTCAAAGCTCAACAGCTTTTTAAAATAAGGAATCCTATAATGGCCAAACGAATACT

ATAAAAATAAGGGTTCTCTTAATTGTATAAAACGTATAATTTTATCAATTTTGGGACCGT

GTAATTTTTTAAAGACCACAAGAATGTTACATACAACAAATAGACGAAACTCGTAGCTTT

GGAAACTACGTCATGGGCGTTTGGTCAAAAGCTGGAGAGAAAGAGAGGTGGGGTGCCAGA

CTTAAGTAGTCACGTGATCTGACCAACGCACATCGGAAGCTCGATCGGATGAAATCTTCT


In [4]:
!fgrep -c ">" /Users/sr320/Dropbox/Steven/eimd/data/Phel_transcriptome_clc.fa
30578


In []:
#IMPORTANT the location of files will change depending on your computer
blastx 
-query /Users/sr320/Dropbox/Steven/eimd/data/Phel_transcriptome_clc.fa 
-db /Users/Shared/data/blast/db/uniprot_sprot 
-out /Users/sr320/Dropbox/Steven/eimd/data/Phel_clc_blastx_uniprot_sprot_1.tab 
-outfmt 6 
-num_threads 8 
-max_hsps 1 
-max_target_seqs 1 
-evalue 1E-20
In [11]:
!head /Users/sr320/Dropbox/Steven/eimd/data/Phel_clc_blastx_uniprot_sprot_1.tab
Phel_clc_contig_4	sp|P25001|COX1_PISOC	88.39	517	48	1	7061	5547	1	517	0.0	  749

Phel_clc_contig_7	sp|Q33818|CYB_ASTPE	79.94	329	66	0	993	7	51	379	9e-168	  479

Phel_clc_contig_8	sp|P68037|UB2L3_MOUSE	76.97	152	35	0	4862	4407	1	152	7e-62	  214

Phel_clc_contig_9	sp|Q0MVN8|QOR_PIG	45.61	239	129	1	796	80	90	327	5e-63	  210

Phel_clc_contig_17	sp|Q6DGL8|RT15_DANRE	35.00	180	107	3	1177	638	61	230	5e-22	99.8

Phel_clc_contig_18	sp|P96202|PPSC_MYCTU	30.81	714	438	15	5407	3386	1414	2111	6e-76	  286

Phel_clc_contig_20	sp|P46058|EDSP_CYNPY	31.03	348	218	8	1731	703	4	334	5e-38	  148

Phel_clc_contig_22	sp|Q96LI5|CNO6L_HUMAN	60.78	357	128	5	1887	832	186	535	2e-149	  450

Phel_clc_contig_24	sp|P63245|GBLP_RAT	80.77	312	60	0	1032	97	1	312	0.0	  540

Phel_clc_contig_25	sp|Q9QYP1|LRP4_RAT	32.74	623	393	7	1816	5	393	1008	1e-99	  339


In [12]:
!tr '|' "t" </Users/sr320/Dropbox/Steven/eimd/data/Phel_clc_blastx_uniprot_sprot_1.tab> /Users/sr320/Dropbox/Steven/eimd/data/Phel_clc_blastx_uniprot_sprot_sqlready.tab
In [13]:
!head /Users/sr320/Dropbox/Steven/eimd/data/Phel_clc_blastx_uniprot_sprot_sqlready.tab
Phel_clc_contig_4	sp	P25001	COX1_PISOC	88.39	517	48	1	7061	5547	1	517	0.0	  749

Phel_clc_contig_7	sp	Q33818	CYB_ASTPE	79.94	329	66	0	993	7	51	379	9e-168	  479

Phel_clc_contig_8	sp	P68037	UB2L3_MOUSE	76.97	152	35	0	4862	4407	1	152	7e-62	  214

Phel_clc_contig_9	sp	Q0MVN8	QOR_PIG	45.61	239	129	1	796	80	90	327	5e-63	  210

Phel_clc_contig_17	sp	Q6DGL8	RT15_DANRE	35.00	180	107	3	1177	638	61	230	5e-22	99.8

Phel_clc_contig_18	sp	P96202	PPSC_MYCTU	30.81	714	438	15	5407	3386	1414	2111	6e-76	  286

Phel_clc_contig_20	sp	P46058	EDSP_CYNPY	31.03	348	218	8	1731	703	4	334	5e-38	  148

Phel_clc_contig_22	sp	Q96LI5	CNO6L_HUMAN	60.78	357	128	5	1887	832	186	535	2e-149	  450

Phel_clc_contig_24	sp	P63245	GBLP_RAT	80.77	312	60	0	1032	97	1	312	0.0	  540

Phel_clc_contig_25	sp	Q9QYP1	LRP4_RAT	32.74	623	393	7	1816	5	393	1008	1e-99	  339


In []:

 

Share