Skip to content

JeremyQuo/Scripts_merge_DRS_methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scripts_merge_DRS_methods

Scripts to merge tombo and xPore results from ONT data in our Paper (Utilization of Nanopore Direct RNA Sequencing to analyze intracellular viral RNA modifications of Sindbis virus)

1. Install

pip install pandas
pip install matplotlib_venn

2. Usage

This script will help if you get the results from tombo and xPore

For tombo_result should be the suffix of tombo result files,such as sample.level_samp_comp_detect

And xpore_result should be the path of diffmod.table

The following part is the options of this python script.

python main.py -h
usage: main.py [-h] [--tombo_result TOMBO_RESULT] [--xpore_result XPORE_RESULT] [--ref REF] [--output OUTPUT]

optional arguments:
  -h, --help            show this help message and exit
  --tombo_result TOMBO_RESULT
                        suffix of tombo result
  --xpore_result XPORE_RESULT
                        diffmod.table in the result folder from xPore
  --ref REF             reference path
  --output OUTPUT       result path

3. Output

The script will generate three result files.

merged_all.bed : This file is a comprehensive table that combines all prediction values from the xpore and tombo methods using an outer merge. The table can be used to analyze and compare the predictions from both methods. It is recommended to open this file in a text editor or a spreadsheet program for further examination.

intersection.bed : This file contains the intersecting predictions between the xpore and tombo methods. It is specifically formatted as a table and can be easily loaded into applications such as the Integrated Genome Viewer (IGV) tools. The predictions in this file represent regions where both methods agree on their findings, making it useful for focused analysis and visualization.

intersection.pdf : : This file is a graphical representation of the intersecting predictions between the xpore and tombo methods. It is generated as a Venn diagram, which visually depicts the overlapping regions between the two methods such as below.

图片描述

4. Example

python main.py --tombo_result .\data\sample.level_samp_comp_detect --xpore_result .\data\xpore_result\diffmod.table --ref .\data\SINV_Toto1101.fa

5. Preparation (How to run tombo&xPore)

To prepare the required data, you will need the following: For the samples you wanna compare (wild type (WT/) and negative control (IVT/))

  1. Single-format FAST5 files single/): These are the raw signal data files generated by the nanopore sequencer. Ensure that you have the single-format version of these files, which can be coverted from multi format by the ont-fast5-api.
  2. Base-called FASTQ file (all.fastq): This file contains the base-called sequences generated from the raw signal data in the FAST5 files. It should be in the FASTQ format, which includes the sequence reads along with their corresponding quality scores.

Besides ,Reference sequence (ref.fa): This is the reference genome that you want to align your nanopore sequencing data to. It is recommended to use the coding sequence (CDS) version of the reference sequence if available. The reference sequence should be in FASTA format.

Make sure that all of these data files are prepared and available before proceeding with the analysis using tools such as xPore and tombo.

Tombo

For each sample, run the cmds below,

tombo preprocess annotate_raw_with_fastqs --fast5-basedir single/ --fastq-filenames all.fastq --processes 16 --overwrite

tombo resquiggle single ref.fa --processes 16 --num-most-common-errors 5

Then to compare and output the wig file by tombo text_ouput,

tombo detect_modifications level_sample_compare  --fast5-basedirs WT/single/ --alternate-fast5-basedirs IVT/single/  --processes 16 --statistics-file-basename sample.level_samp_comp_detect --store-p-value

tombo text_output browser_files --statistics-filename sample.level_samp_comp_detect.tombo.stats  --browser-file-basename sample.level_samp_comp_detect --file-types statistic 

tombo text_output browser_files --statistics-filename sample.level_samp_comp_detect.tombo.stats  --fast5-basedirs WT/single/ --control-fast5-basedirs IVT/single/ --browser-file-basename sample.level_samp_comp_detect --file-types difference &

For more details, please refer tombo document

xPore

For each sample, run the cmds below,

# alignment
minimap2 -ax map-ont -t 16 ref.fa all.fastq | samtools view -hbS -F 260 - | samtools sort -@ 16 -o all.bam
samtools index all.bam
# nanopolish
nanopolish index -d single/ all.fastq
mkdir nanoplish
nanopolish eventalign --reads all.fastq --bam all.bam --genome ref.fa --signal-index --scale-events --summary ./nanopolish/summary.txt --threads 8 > ./nanopolish/eventalign.txt 
xpore dataprep --eventalign nanopolish/eventalign.txt --transcript_fasta ref.fa --out_dir xpore_dataprep  --n_processes 16

Then to create the config.yml and compare

cat config.yml
---
data:
    IVT:
        REP1: IVT/xpore_dataprep/

    WT:
        REP1: WT/xpore_dataprep/

out: ./xpore_result
---
xpore diffmod --config config.yml --n_processes 16

For more details, please refer xPore document

About

Scripts to merge tombo and xPore results from ONT data in our Paper (Utilization of Nanopore Direct RNA Sequencing to analyze intracellular viral RNA modifications of Sindbis virus)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages