davidebolo1993 / NanoR

Nanopore data analysis in R
GNU Lesser General Public License v3.0
39 stars 10 forks source link

NanoStatsM crashes : Error in seq.default : 'from' must be a finite number #5

Closed AdrienJarretier closed 5 years ago

AdrienJarretier commented 5 years ago

Hello, I have been trying to use NanoR to analyse fast5 files we got from sequencing dna with the MinION.

Whenever i run the MinION data analysis code

it crashes with

NanoStatsM(NanoPrepareMList=List,NanoMTable=Table,DataOut=DATA_OUT_DIR)

Error in seq.default(from = min(round(Relative_Time)), to = max(round(Relative_Time)),  : 
  'from' must be a finite number

Calls: NanoStatsM -> seq -> seq.default

In addition: Warning messages:
1: In max(Time_2) : no non-missing arguments to max; returning -Inf
2: In min(Time_2) : no non-missing arguments to min; returning Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
5: In min(round(Relative_Time)) :
  no non-missing arguments to min; returning Inf
6: In max(round(Relative_Time)) :
  no non-missing arguments to max; returning -Inf
Execution halted

I run Ubuntu 16.04,

and here are my version of R and the packages, they're all greater than the required

> version
               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          5.2                         
year           2018                        
month          12                          
day            20                          
svn rev        75870                       
language       R                           
version.string R version 3.5.2 (2018-12-20)
nickname       Eggshell Igloo              
> packageVersion('ggplot2')
[1] ‘3.1.0’
> packageVersion('reshape2')
[1] ‘1.4.3’
> packageVersion('RColorBrewer')
[1] ‘1.1.2’
> packageVersion('scales')
[1] ‘1.0.0’
> packageVersion('seqinr')
[1] ‘3.4.5’
> packageVersion('gridExtra')
[1] ‘2.3’
> packageVersion('rhdf5')
[1] ‘2.26.2’
> packageVersion('ShortRead')
[1] ‘1.40.0’
> packageVersion('parallel')
[1] ‘3.5.2’
> packageVersion('grid')
[1] ‘3.5.2’
davidebolo1993 commented 5 years ago

Hi @AdrienJarretier, thank You for getting in touch. I cannot replicate the error. However, as NanoStatsM basically parses the Table returned by NanoTableM, can you copy few lines from the previously generated Table (for example, head (Table)) ? It's not an issue related to the package version, I guess.

AdrienJarretier commented 5 years ago

Here it is

> Table<-NanoTableM(NanoPrepareMList=List,DataOut=DATA_OUT_DIR,Cores=6,GCC=TRUE) # extract metadata. You can set "GCC" parameter to FALSE to skip GC content computation.
Extracting metadata from .fast5 files and calculating GC content!
Information Table with GC content count created and saved at ~/NanoRDataOut!
Done!
> 
> head(Table)
  Read Id Channel Number Mux Number Unix Time Length of Read Quality GC_Content
1 Read_Id        Channel        Mux Unix_Time         Length  Qscore GC_Content
2 Read_Id        Channel        Mux Unix_Time         Length  Qscore GC_Content
3 Read_Id        Channel        Mux Unix_Time         Length  Qscore GC_Content
4 Read_Id        Channel        Mux Unix_Time         Length  Qscore GC_Content
5 Read_Id        Channel        Mux Unix_Time         Length  Qscore GC_Content
6 Read_Id        Channel        Mux Unix_Time         Length  Qscore GC_Content

I guess I shouldn't have 6 rows with what looks like column labels in it right ?

davidebolo1993 commented 5 years ago

Exactly. This seems like an issue that occurs if the function cannot read at all your .fast5 files. Are you sure that you have read permissions on the folder that contains .fast5 files ? If you have not, this is the kind of result you get. Another possibility is that your .fast5 files are not basecalled.

Check permissions on the .fast5 folder. If everything seems ok, send me (davidebolognini7@gmail.com) few of your .fast5 files. I’ll check them and let you know.

AdrienJarretier commented 5 years ago

Indeed those fast5 were not basecalled, thank you for that,

I fixed it, I'm using Guppy and I needed to enable the fast5 output flag to get basecalled fast5

but now I get :

NanoStatsM(NanoPrepareMList=List,NanoMTable=Table,DataOut=DATA_OUT_DIR) # plot statistics
Analyzing...
Plotting...
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Error in paste0(Label, "_", label, "_Length_versus_Quality.pdf") : 
  object 'Label' not found
Calls: NanoStatsM -> ggsave -> plot_dev -> force -> paste0
davidebolo1993 commented 5 years ago

Ok. When I updated NanoR last time, I added a piece of code from NanoStatsG into NanoStatsM. Now I modified the .tar.gz. Download the new .tar.gz, re-install NanoR and re-run NanoStatsM. This will work, I suppose.

Let me know

AdrienJarretier commented 5 years ago

Ok it works perfectly now

thank you very much !

davidebolo1993 commented 5 years ago

Let me know if something else is needed ! I'll close the issue.

Best,

Davide