Rsubread align() output_file, dir not created first
1
0
Entering edit mode
@mikelove
Last seen 19 hours ago
United States

hi,

I noticed, when I try to align() and give an output file path which includes a non-existent directory, I get a segfault instead of an error message. Here using development branch, and the example code from the vignette, but adding "foo/" to the output_file argument:

> library(Rsubread) 
> ref <- system.file("extdata","reference.fa",package="Rsubread")        
> buildindex(basename="reference_index",reference=ref)  
> reads <- system.file("extdata","reads.txt.gz",package="Rsubread")       
> align(index="reference_index",readfile1=reads,output_file="foo/alignResults.BAM")                 
                                                                                                     
         ==========     _____ _    _ ____  _____  ______          _____                              
         =====         / ____| |  | |  _ \|  __ \|  ____|   /\   |  __ \                             
           =====      | (___ | |  | | |_) | |__) | |__     /  \  | |  | |                            
             ====      \___ \| |  | |  _ <|  _  /|  __|   / /\ \ | |  | |                            
               ====    ____) | |__| | |_) | | \ \| |____ / ____ \| |__| |                            
         ==========   |_____/ \____/|____/|_|  \_\______/_/    \_\_____/                             
        Rsubread 1.19.3                                                                              
                                                                                                     
 //========================== subread-align setting ===========================\\                    
 ||                                                                            ||                    
 ||           Function : Read alignment                                        ||                    
 ||            Threads : 1                                                     ||                    
 ||         Input file : /home/love/bin/R/library/Rsubread/extdata/reads.t ... ||                    
 ||        Output file : foo/alignResults.BAM (BAM)                            ||                    
 ||         Index name : reference_index                                       ||                    
 ||       Phred offset : 33                                                    ||                    
 ||                                                                            ||                    
 ||          Min votes : 3                                                     ||                    
 ||         Max indels : 5                                                     ||                    
 ||  # of Best mapping : 1                                                     ||                    
 ||     Unique mapping : yes                                                   ||                    
 ||   Hamming distance : yes                                                   ||                    
 ||     Quality scores : no                                                    ||                    
 ||                                                                            ||                    
 \\===================== http://subread.sourceforge.net/ ======================//                    
                                                                                                     
 //====================== Running (11-Sep-2015 10:06:38) ======================\\                    
 ||                                                                            ||                    
 || Decompress /home/love/bin/R/library/Rsubread/extdata/reads.txt.gz...       ||                    
 || The input file contains base space reads.                                  ||                    
 || WARNING The specified phred-score offset (33) seems to be incorrect.       ||                    
 ||         The observed phred-score range is [66,98].                         ||                    
 ||                                                                            ||                    

                                                                                                     
  *** caught segfault ***                                                                            
 address 0x8, cause 'memory not mapped'                                                              
                                                                                                     
 Traceback:                                                                                          
  1: .C("R_align_wrapper", as.integer(n), as.character(cmd), PACKAGE = "Rsubread")                   
  2: align(index = "reference_index", readfile1 = reads, output_file = "foo/alignResults.BAM")       
                                                                                                     
 Possible actions:                                                                                   
 1: abort (with core dump, if enabled)                                                               
 2: normal R exit                                                                                    
 3: exit R without saving workspace                                                                  
 4: exit R saving workspace                                                                          
 Selection:              


> sessionInfo()                                                                                     
 R Under development (unstable) (2015-06-21 r68565)                                                  
 Platform: x86_64-unknown-linux-gnu (64-bit)                                                         
 Running under: Ubuntu 15.04                                                                         
                                                                                                     
 locale:                                                                                             
  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8                      
  [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8                  
  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C                             
 [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C                      
                                                                                                     
 attached base packages:                                                                             
 [1] stats     graphics  grDevices datasets  utils     methods   base                                
                                                                                                     
 other attached packages:                                                                            
 [1] Rsubread_1.19.3                                                                                 
                                                                                                     
 loaded via a namespace (and not attached):                                                          
 [1] compiler_3.3.0 tools_3.3.0     

 

rsubread • 1.5k views
ADD COMMENT
1
Entering edit mode
Wei Shi ★ 3.6k
@wei-shi-2183
Last seen 16 days ago
Australia/Melbourne/Olivia Newton-John …

Hi Michael, thanks for reporting this problem. I have added new code to the function to check if the directory included in the output file name is valid. It will now report an error if the directory does not exist. Changes were just committed to svn devel repository and should be available to you in a couple of days.
 

ADD COMMENT

Login before adding your answer.

Traffic: 1088 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6