{"id":1201,"date":"2019-11-29T10:41:05","date_gmt":"2019-11-29T10:41:05","guid":{"rendered":"https:\/\/jira-test.meb.ki.se\/wpsites\/biostatwiki\/?p=1201"},"modified":"2022-09-21T08:24:18","modified_gmt":"2022-09-21T08:24:18","slug":"xaem-v0-1-0","status":"publish","type":"post","link":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/xaem-v0-1-0\/","title":{"rendered":"XAEM_v0.1.0"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Contents<\/h1>\n\n\n\n<p class=\"has-text-color has-medium-font-size\" style=\"color:#f90800\"><strong>This is the webpage of XAEM version 0.1.0. The most updated version of XAEM is here:  <br><\/strong><a href=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/xaem\/\"><strong>https:\/\/www.meb.ki.se\/sites\/biostatwiki\/xaem\/<\/strong><\/a><strong> <\/strong><\/p>\n\n\n\n<p><a href=\"#sec1\">1. Introduction<\/a><br><a href=\"#sec2\">2. Download and installation<\/a><br><a href=\"#sec3\">3. XAEM: step by step&nbsp;instruction and explanation<\/a><br><a href=\"#sec3_1\">3.1 Preparation for the annotation reference<\/a><br><a href=\"#sec3_2\">3.2 Quantification of transcripts<\/a><br><a href=\"#sec4\">4. A practical copy-paste example of running XAEM<\/a><br><a href=\"#sec5\">5. Dataset for differential expression (DE) analysis<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"sec1\">1. Introduction<\/h1>\n\n\n\n<p>This document shows how&nbsp;to use&nbsp;XAEM [Deng et al., 2019] to&nbsp;quantify isoform expression for <strong>multiple samples<\/strong>.<\/p>\n\n\n\n<p><strong>Software requirements<\/strong> for XAEM:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>R version 3.3.0 or later with installed packages:<strong> foreach<\/strong> and <strong>doParallel<\/strong><\/li><li>C++11 compliant compiler (g++ &gt;= 4.7)<\/li><li>XAEM is currently tested in Linux OS environment<\/li><\/ul>\n\n\n\n<p><strong>Annotation reference:<\/strong> XAEM requires a fasta file of transcript sequences and a gtf file of transcript annotation. XAEM supports all kinds of reference and annotation for any species. In the XAEM paper,&nbsp; we use the UCSC hg19 annotation:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Download the sequences of transcripts:<a href=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/transcripts.fa.gz\">transcripts.fa.gz<\/a><\/li><li>Download the annotation of transcripts:&nbsp;<a href=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/genes_annotation.gtf.gz\">genes_annotation.gtf.gz<\/a><\/li><li>Download the design matrix X of this annotation:&nbsp;&nbsp;<a href=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/X_matrix.RData\">X_matrix.RData<\/a>&nbsp;(X matrix is an essential object for bias correction and isoform quantification, see Section 4.1.2 for more details)<\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"sec2\">2. Download and installation<\/h1>\n\n\n\n<p><strong>If you use the binary version of XAEM (recommended):<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Download the latest binary version&nbsp;from XAEM website:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/XAEM-binary-0.1.0.tar.gz<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Uncompress to folder<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">tar -xzvf XAEM-binary-0.1.0.tar.gz<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Move to the <em><strong>XAEM_home<\/strong><\/em> directory and do the configuration for&nbsp;XAEM<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">cd XAEM-binary-0.1.0\nbash configure.sh\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Add paths of lib folder and bin folder to LD_LIBRARY_PATH and PATH<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">export LD_LIBRARY_PATH=\/path\/to\/XAEM-binary-0.1.0\/lib:$LD_LIBRARY_PATH\nexport PATH=\/path\/to\/XAEM-binary-0.1.0\/bin:$PATH<\/pre>\n\n\n\n<p><strong>If you want to build XAEM&nbsp;from sources:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Download XAEM&nbsp;&nbsp;and move to&nbsp;XAEM<em>_home<\/em>&nbsp;directory<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/XAEM-source-0.1.0.tar.gz\ntar -xzvf XAEM-source-0.1.0.tar.gz\ncd XAEM-source-0.1.0\nbash configure.sh<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>XAEM requires information of flags from Sailfish including DFETCH_BOOST, DBOOST_ROOT, DTBB_INSTALL_DIR and DCMAKE_INSTALL_PREFIX. Please refer to the <a href=\"https:\/\/sailfish.readthedocs.io\/en\/master\/building.html#installation\">Sailfish website<\/a> for more details of these flags.<\/li><li>Do installation by the following command:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">DBOOST_ROOT=\/path\/to\/boostDir\/ DTBB_INSTALL_DIR=\/path\/to\/tbbDir\/ DCMAKE_INSTALL_PREFIX=\/path\/to\/expectedBuildDir bash install.sh<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>After the installation is finished, remember to add the paths of lib folder and bin folder to LD_LIBRARY_PATH and PATH<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">export LD_LIBRARY_PATH=\/path\/to\/expectedBuildDir\/lib:$LD_LIBRARY_PATH\nexport PATH=\/path\/to\/expectedBuildDir\/bin:$PATH<\/pre>\n\n\n\n<p><strong>Do not forget to replace &#8220;\/path\/to\/&#8221; by your local path.<\/strong><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"sec3\">3. XAEM: step by step&nbsp;instruction and explanation<\/h1>\n\n\n\n<p>XAEM mainly contains the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>Preparation for the annotation reference:<\/em>&nbsp; to process the annotation of transcripts to get essential information for transcript quantification. This step includes 1) index transcript sequences and 2) Construct the design matrix X.<\/li><li><em>Quantification of transcripts:<\/em>&nbsp; to get input from multiple RNA-seq samples to do quasi-mapping, generate data for quantifying transcript expression.&nbsp;This step consists of 1) generate equivalence class table; 2) create Y count matrix and 3) estimate transcript expression using AEM algorithm to update the X matrix and transcript (isoform) expression.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sec3_1\">3.1 Preparation for the annotation reference<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"sec3_1_1\">3.1.1 Indexing transcripts<\/h4>\n\n\n\n<p>Using TxIndexer to index the transcript sequences in the reference file (transcripts.fa). For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/transcripts.fa.gz\ngunzip transcripts.fa.gz\nTxIndexer -t \/path\/to\/transcripts.fa -o \/path\/to\/TxIndexer_idx<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"sec3_1_2\">&nbsp;3.1.2 Construction of the X&nbsp;matrix (design matrix)<\/h4>\n\n\n\n<p>This step constructs the X matrix required&nbsp;by the XAEM pipeline. For users working with human&nbsp;annotation of UCSC hg19&nbsp; the X matrix can be downloaded here: <a href=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/X_matrix.RData\">X_matrix.RData<\/a>.<\/p>\n\n\n\n<p>Given file&nbsp;<strong><em>transcripts.fa<\/em><\/strong> containing the transcript sequences of an annotation reference, we construct the design matrix as follows.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>a) Generate simulated RNA-seq data using the R-package &#8220;polyester&#8221;<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">## R-packages of \"polyester\" and \"Biostrings\" are required\nRscript XAEM_home\/R\/genPolyesterSimulation.R \/path\/to\/transcripts.fa \/path\/to\/design_matrix<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>b) Run <em>GenTC<\/em> to generate Transcript Cluster (TC) using the simulated data. GenTC&nbsp;will generate an eqClass.txt file as the input for next step.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">GenTC -i \/path\/to\/TxIndexer_idx -l IU -1 \/path\/to\/design_matrix\/sample_01_1.fasta -2 \/path\/to\/design_matrix\/sample_01_2.fasta -p 8 -o \/path\/to\/design_matrix<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>c) Create a design matrix using&nbsp;buildCRP.R. The parameter setting for this function is as follows.\n<ul><li><em><strong>in<\/strong><\/em>: the input file (eqClass.txt) obtained from the last step.<\/li><li><em><strong>out<\/strong><\/em>: the output file name (*.RData) which the design matrix will be saved.<\/li><li><em><strong>H<\/strong><\/em>: (default H=0.025) is the threshold to filter false positive neighbors in each X matrix. (Please refer to the XAEM paper, Section 2.2.1)<\/li><\/ul>\n<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Rscript XAEM_home\/R\/buildCRP.R in=\/path\/to\/design_matrix\/eqClass.txt out=\/path\/to\/design_matrix\/X_matrix.RData H=0.025<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"sec3_2\">&nbsp;3.2 Quantification of transcripts<\/h3>\n\n\n\n<p>Suppose we already created a working directory &#8220;<em><strong>XAEM_project<\/strong><\/em>&#8221; (\/path\/to\/XAEM_project\/) for quantification of transcripts.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"sec3_2_1\">&nbsp;3.2.1 Generating the equivalence class table<\/h4>\n\n\n\n<p>The command to generate equivalence class table for each sample is similar to &#8220;sailfish quant&#8221;. &nbsp;<em>For example, we want to run XAEM for sample1 and sample2 with 4&nbsp;cpus:<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">XAEM -i \/path\/to\/TxIndexer_idx -l IU -1 s1_read1.fasta -2 s1_read2.fasta -p 4 -o \/path\/to\/XAEM_project\/sample1\nXAEM -i \/path\/to\/TxIndexer_idx -l IU -1 s2_read1.fasta -2 s2_read2.fasta -p 4 -o \/path\/to\/XAEM_project\/sample2\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>If the data is compressed in gz format. We can combine with gunzip for a decompression on-fly:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">XAEM -i \/path\/to\/TxIndexer_idx -l IU -1 &lt;(gunzip -c s1_read1.gz) -2 &lt;(gunzip -c s1_read2.gz) -p 4 -o \/path\/to\/XAEM_project\/sample1\nXAEM -i \/path\/to\/TxIndexer_idx -l IU -1 &lt;(gunzip -c s2_read1.gz) -2 &lt;(gunzip -c s2_read2.gz) -p 4 -o \/path\/to\/XAEM_project\/sample2\n<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec3_2_2\">3.2.2 Creating Y count matrix<\/h5>\n\n\n\n<p>After running XAEM there will be the output of the equivalence class table for <strong>multiple&nbsp;samples<\/strong>. We then create the Y count matrix.&nbsp;For example, if we want to run XAEM parallelly using&nbsp;8 cores, the command is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Rscript Create_count_matrix.R workdir=\/path\/to\/XAEM_project core=8<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"sec3_2_3\">3.2.3 Updating the X matrix and transcript expression using AEM algorithm<\/h4>\n\n\n\n<p>When finish the construction of Y count matrix, we use the AEM algorithm to update the X matrix.&nbsp;The updated X matrix is then used to estimate the transcript (isoform) expression. The command is as follows.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Rscript AEM_update_X_beta.R workdir=\/path\/to\/XAEM_project core=8 design.matrix=X_matrix.RData isoform.out=XAEM_isoform_expression.RData paralog.out=XAEM_paralog_expression.RData merge.paralogs=FALSE isoform.method=average remove.ycount=TRUE<\/pre>\n\n\n\n<p><strong>Parameter setting<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em><strong>workdir<\/strong><\/em>: the path to working directory<\/li><li><em><strong>core<\/strong><\/em>: the number of cpu cores for parallel computing<\/li><li><em><strong>design.matrix<\/strong><\/em>: the path to the design matrix<\/li><li><em><strong>isoform.out<\/strong><\/em> (default=XAEM_isoform_expression.RData):&nbsp; the output contains the estimated expression of <strong>individual transcripts, where the paralogs are split into separate isoforms<\/strong>. This file contains two objects:&nbsp;<strong>isoform_count<\/strong> and <strong>isoform_tpm<\/strong> for estimated counts and normalized values (TPM). The expression of the individual isoforms is calculated with the corresponding setting of parameter &#8220;<em>isoform.method<\/em>&#8221; below.<\/li><li><em><strong>isoform.method<\/strong><\/em> (default=average):&nbsp; to report the expression of the individual members of a paralog as (i) average (default) or (ii) total&nbsp;from the expression of the paralog set.<\/li><li><em><strong>paralog.out<\/strong><\/em> (default=XAEM_paralog_expression.RData): the output contains the estimated expression of<strong>&nbsp;merged paralogs<\/strong>. This file consists of two objects: <strong>XAEM_count<\/strong> and <strong>XAEM_tpm<\/strong>&nbsp; for the estimated counts and normalized values (TPM).<\/li><li><em><strong>merge.paralogs<\/strong><\/em> (default=FALSE) <strong>(*)<\/strong>: the parameter to turn on\/off (value=TRUE\/FALSE) the paralog merging in XAEM.&nbsp;The default is off, which will generate the same set of isoforms between different projects. To turn it on, just add &#8220;merge.paralogs=TRUE&#8221;.<\/li><li><em><strong>remove.ycount<\/strong><\/em> (default=TRUE): to clean all data of Ycount after use.<\/li><\/ul>\n\n\n\n<p>The output in this step will be saved in XAEM_isoform_expression.RData, which is the TPM value and raw read counts of multiple samples.<\/p>\n\n\n\n<p><strong>Note: (*)&nbsp;<\/strong>In XAEM pipeline we provide this parameter (merge.paralog) to merge or not merge the paralogs within the updated X matrix (please see XAEM&nbsp;paper Section 2.2.3 and Section 2.3).&nbsp; <em><strong>Turning on the paralog merging step produces a more accurate estimation. Turning off this step (default) can produce the same sets of isoforms between different projects.<\/strong><\/em><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"sec4\">4. A practical copy-paste example of running XAEM<\/h1>\n\n\n\n<p>This section presents a tutorial to run XAEM pipeline with a toy example. Suppose that input data contain&nbsp;<strong><em>two RNA-seq samples<\/em><\/strong> and server supplies <strong><em>4CPUs<\/em><\/strong> for computation. We can test XAEM by just&nbsp;copy and paste of the example commands.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Download the binary version of XAEM and do configuration<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"># Create a working folder\nmkdir XAEM_example\ncd XAEM_example\n# Download the binary version of XAEM\nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/XAEM-binary-0.1.0.tar.gz\n\n# Configure the tool\ntar -xzvf XAEM-binary-0.1.0.tar.gz\ncd XAEM-binary-0.1.0\nbash configure.sh\n\n# Add the paths to system\nexport LD_LIBRARY_PATH=$PWD\/lib:$LD_LIBRARY_PATH\nexport PATH=$PWD\/bin:$PATH\ncd ..\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Download&nbsp; annotation files and index the transcripts<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">## download annotation files\n# Download the design matrix for the human UCSC hg19 annotation \nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/X_matrix.RData\n\n# Download the fasta of transcripts in the human UCSC hg19 annotation \nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/transcripts.fa.gz\ngunzip transcripts.fa.gz\n\n## Run XAEM indexer\nTxIndexer -t transcripts.fa -o TxIndexer_idx\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Download the RNA-seq data of two samples: sample1 and sample2<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">## Download input RNA-seq samples\n# Create a XAEM project to save the data\nmkdir XAEM_project\ncd XAEM_project\n\n# Download the RNA-seq data\nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/sample1_read1.fasta.gz\nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/sample1_read2.fasta.gz\nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/sample2_read1.fasta.gz\nwget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/sample2_read2.fasta.gz\ncd ..\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Generate the equivalence class tables for these samples<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"># Number of CPUs\nCPUNUM=4\n\n# Process for sample 1\nXAEM -i TxIndexer_idx -l IU -1 &lt;(gunzip -c XAEM_project\/sample1_read1.fasta.gz) -2 &lt;(gunzip -c XAEM_project\/sample1_read2.fasta.gz) -p $CPUNUM -o XAEM_project\/sample1\n\n# Process for sample 2\nXAEM -i TxIndexer_idx -l IU -1 &lt;(gunzip -c XAEM_project\/sample2_read1.fasta.gz) -2 &lt;(gunzip -c XAEM_project\/sample2_read2.fasta.gz) -p $CPUNUM -o XAEM_project\/sample2\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Create Y count matrix<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong># Note: R packages \"foreach\"&nbsp;and&nbsp;\"doParallel\" are required for parallel computing<\/strong>\nRscript $PWD\/XAEM-binary-0.1.0\/R\/Create_count_matrix.R workdir=$PWD\/XAEM_project core=$CPUNUM design.matrix=$PWD\/X_matrix.RData\n<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Estimate isoform expression using AEM algorithm<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">Rscript $PWD\/XAEM-binary-0.1.0\/R\/AEM_update_X_beta.R workdir=$PWD\/XAEM_project core=$CPUNUM design.matrix=$PWD\/X_matrix.RData isoform.out=XAEM_isoform_expression.RData paralog.out=XAEM_paralog_expression.RData\n<\/pre>\n\n\n\n<p>The outputs are stored in the folder of &#8220;XAEM_project&#8221; including<em>&nbsp;XAEM_isoform_expression.RData<\/em> and&nbsp;<em>XAEM_paralog_expression.RData<\/em>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"sec5\">5. Dataset for differential expression (DE) analysis<\/h1>\n\n\n\n<p>In XAEM paper we have used the RNA-seq data from the breast cancer cell line (MDA-MB-231) for DE analysis. Since the original data was generated by our collaborators and not published yet, we provide the equivalence class table by running the read-alignment tool Rapmap, which is the same mapper of Salmon and totally independent from XAEM algorithm. We also prepare the R scripts and the guide to replicate the DE analysis results in the paper.<\/p>\n\n\n\n<p>In this section, we present an instruction to download the data and run the scripts. We try to build the pipeline following the copy-paste manner in shell, but the part of R scripts must be run in R console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5.1 Download the R-scripts and the design matrix<\/h2>\n\n\n\n<p>This step is to download the R-scripts, change directory to the folder containing the R-scripts and download the design matrix.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Download R-scripts<br>wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/brca_singlecell\/RDR_brca_singlecell.zip\nunzip RDR_brca_singlecell.zip\ncd RDR_brca_singlecell<br><br># Download the design matrix<br>wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/X_matrix.RData\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5.2 Run XAEM from the&nbsp;equivalence class tables which are the output of read-alignment tool Rapmap<\/h2>\n\n\n\n<p>Download the data of&nbsp;equivalence classes<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Download the table of equivalence classes of the single cells which are the output of read-alignment tool Rapmap<br><br>wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/brca_singlecell\/brca_singlecell_eqclassDir.zip<br>unzip brca_singlecell_eqclassDir.zip\n<\/pre>\n\n\n\n<p>Run XAEM with the input from the equivalence class table using the R-codes below.&nbsp;<em><strong>Note:<\/strong><\/em>&nbsp;&nbsp;This step takes about 2 hours using a personal computer with 4 CPUs. Users can consider skipping this step and downloading the available XAEM results for the downstream analysis.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># set the project path\nprojPath=getwd();\nsetwd(projPath)\nsource(\"collectDataOfXAEM.R\")\n<\/pre>\n\n\n\n<p>If users want to download the available XAEM results<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Download the available results of XAEM<br><br>wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/brca_singlecell\/XAEM_results.zip<br>unzip XAEM_results.zip\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">5.3&nbsp;Differential-expression analysis of XAEM and other methods<\/h2>\n\n\n\n<p>Download the data of cufflinks and salmon. These files contain the read-count data of methods with and without using bias correction.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Download the results of cufflinks<br>wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/brca_singlecell\/cufflinks_results.zip<br>unzip cufflinks_results.zip<br><br># Download the results of salmons<br>wget https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/XAEM_datasources\/brca_singlecell\/salmon_results.zip<br>unzip salmon_results.zip<\/pre>\n\n\n\n<p>Run the codes below in R to do normalization and differential expression analysis.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># set the project path<br>projPath=getwd();<br>setwd(projPath)<br><br># Normalize the data of three methods XAEM, Salmon and Cufflinks<br>source(\"Isoform_Expression_CPM_Normalization.R\")<br><br># Do DE analysis and plot figures<br>source(\"DEanalysis_plots.R\")<br><br># output: DE_Analysis.png<\/pre>\n\n\n\n<p>The results of the&nbsp;differential expression analysis (Figure 1 below) are the plots (<em>DE_Analysis.png<\/em>) reproducing Figure 3 of the XAEM paper. Note that&nbsp;due to the randomness of 50 times&#8217; run, the figure might be slightly different from the figure in the paper.<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone\"><a href=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA-1024x1024.png\" alt=\"\" class=\"wp-image-1144\" srcset=\"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA-1024x1024.png 1024w, https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA-150x150.png 150w, https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA-300x300.png 300w, https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA-768x768.png 768w, https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA-624x624.png 624w, https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-content\/uploads\/sites\/4\/2019\/06\/DE_Analysis_brca_sc_RDA.png 1400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption><strong>Figure 1.<\/strong> Detection and validation of differentially expressed (DE) isoforms using the MDA- MB-231 scRNA-seq dataset. XAEM, Salmon and Cufflinks are presented in blue-solid, red-dashed and grey-dotted lines, respectively. The x-axis shows the number of top DE isoforms in the training set; the y-axis is the proportion of rediscovery in the validation set. The rediscovery rate (RDR) is calculated by comparing the top 100, 500 and 1000 DE isoforms from the training set with all the significant DE isoforms from the validation set. The boxplots show the RDR from 50 times\u2019 run. (a) Both training set and validation set are constructed using cells from batch 1. The quantification of XAEM, Salmon and Cufflinks is performed without bias correction. (b) The quantification from the three methods are bias- corrected. (c) The training set is constructed using cells from batch 1, while the validation set uses cells from batch 2. The RDR is calculated for only singleton isoforms. (d) The training set is constructed using cells from batch 1, and the validation set using cells from batch 2. The RDR is calculated using only non-paralogs.<\/figcaption><\/figure>\n\n\n\n<p><strong>References:&nbsp;<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Deng, Wenjiang, Tian Mou, Nifang Niu, Liewei Wang, Yudi Pawitan, and Trung Nghia Vu. 2019. \u201cAlternating EM Algorithm for a Bilinear Model in Isoform Quantification from RNA-Seq Data.\u201d Bioinformatics.&nbsp; https:\/\/doi.org\/10.1093\/bioinformatics\/btz640.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Contents This is the webpage of XAEM version 0.1.0. The most updated version of XAEM is here: https:\/\/www.meb.ki.se\/sites\/biostatwiki\/xaem\/ 1. Introduction2. Download and installation3. XAEM: step by step&nbsp;instruction and explanation3.1 Preparation for the annotation reference3.2 Quantification of transcripts4. A practical copy-paste example of running XAEM5. Dataset for differential expression (DE) analysis 1. Introduction This document shows [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1201","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/posts\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/comments?post=1201"}],"version-history":[{"count":4,"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/posts\/1201\/revisions"}],"predecessor-version":[{"id":1344,"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/posts\/1201\/revisions\/1344"}],"wp:attachment":[{"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/media?parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/categories?post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.meb.ki.se\/sites\/biostatwiki\/wp-json\/wp\/v2\/tags?post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}