Code Monkey home page Code Monkey logo

ribo-oddr's People

Contributors

ferhatalkan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ribo-oddr's Issues

Issue with execution of the Ribo-ODDR tool

I am trying to design rRNA depletion probes and I tried to use the example data with mouse_rRNA.fa as -r input and then placed the output in the current directory

it gives this error

Traceback (most recent call last):
File "src/Ribo-ODDR.py", line 495, in
main()
File "src/Ribo-ODDR.py", line 317, in main
if len(args.samples)<1:
TypeError: object of type 'NoneType' has no len()

Can you please explain whats going on ?

Order of 10+ samples

If there are less than 10 samples, they are correctly ordered S1_X..., S2_X..., S3_X......
But if there are e.g. 21 samples, they are ordered as S1_X..., S10_X..., S11_X..., ...,S19_X..., S2_X..., S20_X..., S21_X..., S3_X..., S4_X..., ..., S9_X..., so the original order is lost.

Probably the easiest repair is to add enough leading zeros to all numbers have the same length.
E.g. to replace

    tmp[[paste("S", as.character(i), "_", sample, "_reads_info", sep="")]] <- reads[,sample]
    tmp[[paste("S", as.character(i), "_", sample, "_rrna_per_info", sep="")]] <- rperc[,sample]

with

    tmp[[paste("S", sprintf(paste0("%0",nchar(as.character(length(samples))),"d"),i), "_", sample, "_reads_info", sep="")]] <- reads[,sample]
    tmp[[paste("S", sprintf(paste0("%0",nchar(as.character(length(samples))),"d"),i), "_", sample, "_rrna_per_info", sep="")]] <- rperc[,sample]

I.e. replace as.character(i) with sprintf(paste0("%0",nchar(as.character(length(samples))),"d"),i).

ImportError: Bio.Alphabet has been removed from Biopython.

Hi, I got an error message when using src/Ribo-ODDR.py -h, which seems to be raised because I am now using biopython==1.78, which removed Bio.Alphabet, and I guess it might work if I rolled back to early versions. Do you have any suggestions?

Traceback (most recent call last):
File "src/Ribo-ODDR.py", line 37, in
from Bio.Alphabet import generic_dna, generic_rna
File "/home/ywei/.local/lib/python3.8/site-packages/Bio/Alphabet/init.py", line 20, in
raise ImportError(
ImportError: Bio.Alphabet has been removed from Biopython.

Regards,
Iris

Issue with running the script: IndexError: list index out of range

Hello,
I have encountered an issue while trying to design oligos for my experiment. The script threw an IndexError, as shown in the output below.

The fasta file is the same I used for aligning, the bam file also works fine for other applications but I'm not ruling out my files being the cause.

I'd be deeply grateful for any help, thanks!

Command:
src/Ribo-ODDR.py -r my-data/Saccharomyces_cerevisiae.R64-1-1.ncrna.fa -o ./ -ap ./my-data/ -as .bam -s ncrna_mapped_sorted --RIsearch2_exe /home/janm/.conda/pkgs/risearch-2.1-h9bf148f_0/bin/RIsearch2

Output and error message (some parts omitted for brevity):

#### Ribo-ODDR: Ribo-seq Oligo Design for Depleting rRNAs ####                                                                                                                                                                              
#### PIPELINE STARTED ####                                                                                                                                                                                                                  
#### These are the given args ####                                                                                                                                                                                                          
# rRNA_seqs my-data/Saccharomyces_cerevisiae.R64-1-1.ncrna.fa                                                                                                                                                                               
# output output                                                                                                                                                                                                                             
# RIsearch2_exe /home/janm/.conda/pkgs/risearch-2.1-h9bf148f_0/bin/RIsearch2                                                                                                                                                                
# bowtie2_build_exe None                                                                                                                                                                                                                    
# tophat_exe None                                                                                                                                                                                                                           
# samtools_exe None                                                                                                                                                                                                                         
# RNAfold_exe None                                                                                                                                                                                                                          
# OFFtargets None                                                                                                                                                                                                                           
# OFFtargetsSUF None                                                                                                                                                                                                                        
# samples ['ncrna_mapped_sorted']                                                                                                                                                                                                           
# fastq_prefix None                                                                                                                                                                                                                         
# fastq_suffix None                                                                                                                                                                                                                         
# alignment_prefix ./my-data/                                                                                                                                                                                                               
# alignment_suffix .bam                                                                                                                                                                                                                     
# range 25-30                                                                                                                                                                                                                               
# force_design 20                                                                                                                                                                                                                           
# oligos2optimize None                                                                                                                                                                                                                      
# rrna_perc_threshold 5.0                                                                                                                                                                                                                   
# score_threshold 0.25                                                                                                                                                                                                                      
#### END of the given args ####                                                                                                                                                                                                             
#### RUN started ####                                                                                                                                                                                                                       
#### WORKING IN /home/janm/Ribo-ODDR/output directory ####                                                                                                                                                                                  
#rRNA sequence read: snR7-L_snRNA 214 nts                                                                                                                                                                                                   
#rRNA sequence read: snR14_snRNA 160 nts                                                                                                                                                                                                    
#rRNA sequence read: snR6_snRNA 112 nts                                                                                                                                                                                                     

...

#Allowed lengths for oligo designs:  range(25, 31)  nts                                                                                                                                                                                     
### Reading ncrna_mapped_sorted alignment file and getting depth profile.                                                                                                                                                                   
# 12  primary-aligned reads on snR7-L_snRNA for sample ./my-data/ncrna_mapped_sorted.bam                                                                                                                                                    
# 5  primary-aligned reads on snR14_snRNA for sample ./my-data/ncrna_mapped_sorted.bam 
# 0  primary-aligned reads on snR6_snRNA for sample ./my-data/ncrna_mapped_sorted.bam    
# 30  primary-aligned reads on LSR1_snRNA for sample ./my-data/ncrna_mapped_sorted.bam   
# 15  primary-aligned reads on snR19_snRNA for sample ./my-data/ncrna_mapped_sorted.bam   
# 1  primary-aligned reads on snR7-S_snRNA for sample ./my-data/ncrna_mapped_sorted.bam 

...

# 3  primary-aligned reads on snR41_snoRNA for sample ./my-data/ncrna_mapped_sorted.bam
# 2  primary-aligned reads on snR69_snoRNA for sample ./my-data/ncrna_mapped_sorted.bam
# 0  primary-aligned reads on snR53_snoRNA for sample ./my-data/ncrna_mapped_sorted.bam
# 13  primary-aligned reads on snR8_snoRNA for sample ./my-data/ncrna_mapped_sorted.bam
794106 rRNA mapping reads
# Oligo design starts now
# First locating suboptimal binding regions
# WARNING:  /home/janm/Ribo-ODDR/RIsearch2_suboptimal_oligobind_results already exists
# Running RIsearch2 for length=25 oligos
# Running RIsearch2 for length=26 oligos
# Running RIsearch2 for length=27 oligos
# Running RIsearch2 for length=28 oligos
# Running RIsearch2 for length=29 oligos
# Running RIsearch2 for length=30 oligos
# Calculating oligo potentials
## Designing for size 25                                     
## Designing for TX snR7-L_snRNA                               
## Designing for TX snR14_snRNA                               
## Designing for TX snR6_snRNA                               
## Designing for TX LSR1_snRNA                               
Traceback (most recent call last): finished)    
  File "src/Ribo-ODDR.py", line 609, in <module>
    main()
  File "src/Ribo-ODDR.py", line 476, in main
    risearch=risearch_exe, rRNAs_suf=rRNAs_suf, working_dir=output_path)
  File "src/Ribo-ODDR.py", line 267, in get_oligos_with_reads_start_end
    read_basin = ALL_READS_START_END[sample][rt_tarTX][r]
IndexError: list index out of range

Ribo-ODDR.py runs on Python 3 while TopHat2 on Python 2.7

Hi, when I ran Ribo-ODDR.py using trimmed-read files, I used the following command (the arguments were successfully parsed) and got the following error message. I suspect that this might be because I ran this command under a conda environment where Python 3, Biopython 1.76 and pysam are installed, while TopHat v2.1.1 (the latest version) uses Python 2.7 (TopHat2 is installed on our campus cluster), so when TopHat2 was run using Python 3, some error occurred. I am wondering if there is any way to solve this problem. Thanks!

Command:

python Ribo-ODDR.py -r rRNA_20210321.fasta -o out -fp trimmed -fs .fq --bowtie2-build_exe d --samtools_exe d --tophat_exe d -s S1_trimmed --RIsearch2_exe d

Error message:

ERROR: File "/opt/apps/rhel7/tophat-2.1.1/bin/tophat", line 1003
except getopt.error, msg:
^
SyntaxError: invalid syntax

Target with colon

Oligo-selector crashes if target name contains colon.

The easiest repair is probably to replace

    target=sapply(raw_df$target,FUN=function(x){return(strsplit(x,":")[[1]][1])}),
    spos=as.numeric(sapply(raw_df$target,FUN=function(x){return(strsplit(strsplit(x,":")[[1]][2], "-")[[1]][1])})),
    epos=as.numeric(sapply(raw_df$target,FUN=function(x){return(strsplit(strsplit(x,":")[[1]][2], "-")[[1]][2])})),

with

    target=sapply(raw_df$target,FUN=function(x){return(strsplit(x,":(?=[^:]+$)",perl=TRUE)[[1]][1])}),
    spos=as.numeric(sapply(raw_df$target,FUN=function(x){return(strsplit(strsplit(x,":(?=[^:]+$)",perl=TRUE)[[1]][2], "-")[[1]][1])})),
    epos=as.numeric(sapply(raw_df$target,FUN=function(x){return(strsplit(strsplit(x,":(?=[^:]+$)",perl=TRUE)[[1]][2], "-")[[1]][2])})),

I.e. replace ":" with ":(?=[^:]+$)",perl=TRUE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.