Debian Codegraph @

docs/tutorial-cgp/rnaseq+liftover.html

raw
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <html><head><title>Predicting Genes with AUGUSTUS</title>
3 <link rel="stylesheet" type="text/css" href="augustus.css">
4 <script src="tutorial.js" type="text/javascript"></script>
5 </head><body>
6 <font size=-1>
7 Navigate to <a href="index.html">main AugCGP tutorial</a>.
8 <a href="cactus.html">Cactus alignments and assembly Hubs</a>.
9 <a href="de_novo.html">AugCGP de novo</a>.
10 <a href="rnaseq.html">AugCGP with RNA-Seq</a>.
11 <a href="liftover.html">Annotation transfer with AugCGP</a>.
12 <a href="hgm.html">Cross-species consistency of gene sets</a>.
13 </font>
14 <div align="right">Show <a href="javascript:allOn()">all</a> / <a href="javascript:allOff()">no</a> details.</div>
15
16 <h1>Combining Annotation transfer and RNA-Seq-based prediction</h1>
17
18 In the typical clade annotation scenario, most genomes are supplemented with RNA-Seq data, whereas a few may represent model organsims for which high quality annotations exist (e.g. human and mouse in the vertebrate clade). This tutorial describes how RNA-Seq evidence and evidence from existing annotations can be combined in Augustus-cgp.
19
20
21 <h2 id="loadAnno">1. Create a database with RNA-Seq and annotation hints</h2>
22
23 If you don't have a database with the genomes and RNA-Seq hints, yet, <span class="assignment">follow</span> the instructions in
24 <a href="rnaseq.html#loadRNASeq">1. Load RNA-Seq hints ...</a><br>
25 to create the database <tt>vertebrates_rnaseq.db</tt>.<br><br>
26 <span class="assignment">Make</span> a copy of the database
27 <pre class="code">
28 cp vertebrates_rnaseq.db vertebrates_rnaseq+anno.db
29 </pre>
30 and <span class="assignment">load</span> the annotation hints from
31 <a href="liftover.html#refseq2hints">exercise 4.1</a> into the new database
32 <pre class="code">
33 load2sqlitedb --species=hg38 --dbaccess=vertebrates_rnaseq+anno.db refseq/hg38.hints.gff
34 </pre>
35
36 You can <span class="assignment">check</span> if loading was successful with following
37 database query
38 <pre class="code">
39 sqlite3 -header -column vertebrates_rnaseq+anno.db "SELECT count(*) AS '#hints',typename,speciesname FROM
40 (hints as H join featuretypes as F on H.type=F.typeid) natural join speciesnames group by speciesid,typename;"
41 </pre>
42 that returns a summary of how many hints of each type are in the database for each species.<br>
43 Your database should now contain both RNA-Seq hints from vertebrates_rnaseq.db and annotation hints from vertebrates_anno.db
44 <pre class="code">
45 #hints typename speciesname
46 ---------- ---------- -----------
47 3368 exonpart galGal4
48 129 intron galGal4
49 86 CDS hg38
50 7905 exonpart hg38
51 345 intron hg38
52 7930 exonpart mm10
53 378 intron mm10
54 11050 exonpart rheMac3
55 265 intron rheMac3
56 </pre>
57
58 <h2 id="extrinsic">3. Prepare an extrinsic config file</h2>
59
60 Start by <span class="assignment">copying</span> following extrinsic configuration file:
61 <pre class="code">
62 cp ${AUGUSTUS_CONFIG_PATH}extrinsic/extrinsic-cgp.cfg extrinsic-rnaseq+anno.cfg
63 </pre>
64 <span class="assignment">Open</span> the <tt>extrinsic-rnaseq+anno.cfg</tt> file with a text editor,
65 <span class="assignment">go</span> to the first <tt>[GROUP]</tt> section and replace the following line
66 <pre class="code">
67 [GROUP] # replace 'none' by the names of genomes with src=W and src=E hints in the database
68 none
69 </pre>
70 by the names of genomes with annotation RNA-Seq hints, i.e.
71 <pre class="code">
72 [GROUP]
73 hg38 mm10 rheMac3 galGal4
74 </pre>
75 Note, that in our case, nothing further has to be done, since the only genome with annotation hints - hg38 -
76 is already covered in the first table. In other applications, you may have genomes with annotations, but
77 no RNA-Seq data. In this case the names of the genomes that ONLY have annotation hints must be listed in the
78 second [GROUP] section.<br><br>
79
80 <a href="javascript:onoff('cfg')" class="dlink"><span id="cfg" title="cfgd" class="dcross">[+]</span>
81 <span class="dtitle">format of the extrinsic.cfg file in cgp mode ...</span></a> <br>
82 <div id="cfgd" class="details" style="display:none;">
83 In cgp mode hints can be integrated for multiple species.
84 In order to have different extrinsic config settings for different species,
85 multiple <tt>[GENERAL]</tt> tables are specified. Each table is followed by a <tt>[GROUP]</tt> section,
86 a single line, in which a subset of the species is listed, for which the table is valid.
87 Use the same species identifiers as in the genome alignment and in the phylogenetic tree.
88 If a species is not assigned to any of the tables, all hints for that species are
89 ignored. To assign all species to a single table, the key 'all' can be used instead of itemizing
90 every single species identifier. Use the key 'other' to specify a table for all species, not
91 listed in any previous table.
92 Note that the source RM must be specified in case that the softmasking option is turned on.
93 Also note that all tables have the same dimension, i.e. each table must contain all sources
94 listed in the section <tt>[SOURCES]</tt>, even sources for which no hints exist for any of species
95 in group.
96 </div>
97 </br>
98
99 <h2 id="runAug">4. Run AUGUSTUS-CGP with RNA-Seq and annotation hints</h2>
100
101 <span class="assignment">Create</span> a new folder for the liftover experiments and
102 <span class="assignment">switch</span> to the new directory
103 <pre class="code">
104 mkdir augCGP_rnaseq+liftover
105 cd augCGP_rnaseq+liftover
106 </pre>
107 For convenience <span class="assignment">assign</span> each alignment chunk to a job ID by
108 creating softlinks
109 <pre class="code">
110 num=1
111 for f in ../mafs/*.maf; do ln -s $f $num.maf; ((num++)); done
112 </pre>
113 <span class="assignment">Run</span> Augustus with retrieval of hints from the
114 database (~3min).<br>
115 <pre class="code">
116 for id in *.maf
117 do
118 augustus \
119 --species=human \
120 --softmasking=1 \
121 --treefile=../tree.nwk \
122 --alnfile=$id \
123 --dbaccess=../vertebrates_rnaseq+anno.db \
124 --speciesfilenames=../genomes.tbl \
125 --alternatives-from-evidence=0 \
126 --dbhints=1 \
127 --UTR=1 \
128 --allow_hinted_splicesites=atac \
129 --extrinsicCfgFile=../extrinsic-rnaseq+anno.cfg \
130 --/CompPred/outdir=pred${id%.maf} &gt aug${id%.maf}.out 2&gt err${id%.maf}.out &
131 done
132 </pre>
133 This will generate the folders <span class="result"><tt>pred*/</tt></span> (one for each alignment chunk)
134 that contain gff files with gene predictions for each input genome.
135 <pre class="code">
136 bosTau8.cgp.gff
137 canFam3.cgp.gff
138 galGal4.cgp.gff
139 hg38.cgp.gff
140 mm10.cgp.gff
141 monDom5.cgp.gff
142 rheMac3.cgp.gff
143 rn6.cgp.gff
144 </pre>
145
146 Note that the parallelization with the bash '&' command above is quite simple and rather for demonstration purposes.<br>
147 For real applications with several hundreds or thousands of alignment chunks, we recommend to
148 run job arrays on a compute cluster.
149
150 <h2 id="abinitiopred"><a href="de_novo.html#merge">5. Merge gene predictions from parallel runs</a></h2>
151
152 <h2 id="makeBeds">6. Upload gene predictions into the assembly hub</h2>
153 <span class="assignment">Convert</span> the final gene predictions from gff to BED format and place
154 each BED file in a separate folder with the name of the corresponding genome. It is important that directory names are consistent with the names in the HAL alignment.
155 <pre class="code">
156 for f in joined_pred/*.gff
157 do
158 mkdir "$(basename $f .gff)"
159 gtf2bed.pl <$f >$(basename $f .gff)/augCGP_rnaseq+anno.bed --itemRgb=255,165,0
160 done
161 </pre>
162 Specify any RGB color you like for the track with option <tt>--itemRgb</tt>, e.g. <span style="color:rgb(255,165,0);">255,165,0.</span><br>
163 The name of the current directory (i.e. <tt>augCGP_rnaseq+liftover</tt>) will be used as track name on the browser.<br>
164
165 <span class="assignment">Switch</span> back to the main working directory <tt>data/</tt>
166 <pre class="code">
167 cd ..
168 </pre>
169 and rerun the <tt>hal2assemblyHub.py</tt> script. Include gene tracks with option <tt>--bedDirs</tt>
170
171 <pre class="code">
172 hal2assemblyHub.py vertebrates.hal vertHub --lod \
173 --alignability --gcContent \
174 --hub vertCompHub --shortLabel VertebratesCompHub \
175 --bedDirs augCGP_rnaseq+liftover \
176 --tabBed \
177 --maxThreads=10 --longLabel "Vertebrates Comparative Assembly Hub"
178 </pre>
179 You can also include gene tracks from other exercises by passing a comma-separated list of directories e.g.
180 <tt>--bedDirs refseq,augCGP_denovo,augCGP_rnaseq,augCGP_liftover,...</tt><br><br>
181 <span class="assignment">Repeat</span> <a href="cactus.html#loadHub">4. Load the hub and browser the alignment</a>.<br>
182 </body></html>