dereneaton / ipyrad

Interactive assembly and analysis of RAD-seq data sets
http://ipyrad.readthedocs.io
GNU General Public License v3.0
70 stars 39 forks source link

Step 6 KeyError: 'reference' #392

Closed isaacovercast closed 4 years ago

isaacovercast commented 4 years ago

I will bet good money it's because the chrom names are being parsed and cast to int, and then accessed as str.

  [####################] 100% 0:00:42 | concatenating bams                                                                                                                                                           
  [####################] 100% 0:00:18 | fetching regions                                                                                                                                                             
  [####################] 100% 0:00:10 | building database                                                                                                                                                            
  Encountered an Error.                                                                                                                                                                                              
  Message: KeyError: u'1'

  Parallel connection closed.                                                                                                                                                                                        
KeyErrorTraceback (most recent call last)<string> in <module>()                                                                                                                                                      
/home/isaac/ipyrad/ipyrad/ipyrad/assemble/clustmap_across.pyc in build_ref_clusters(data, idx, iregion)                                                                                                              
    805         clust = [">reference_{}:{}:{}-{}\n{}".format(                                                                                                                                                        
    806             0,                                                                                                                                                                                               
--> 807             faidict[region[0]] + 1, mstart + 1, mend + 1,   # 1-indexed                                                                                                                                      
    808             b"".join(arr[0]).decode()                                                                                                                                                                        
    809         )]                                                                                                                                                                                                   
KeyError: u'1' 
isaacovercast commented 4 years ago

Got it in one.

Modify ipyrad.assemble.util.chroms2ints to cast the 'scaffold' column to str, to allow integer scaffold names. BAM!

a53379c