def parse_fields( self ):
"""
Read in the fields contained in the output files from methylprofiles.
"""
m = np.loadtxt(self.mfn, dtype="str", skiprows=1)
o = np.loadtxt(self.ofn, dtype="str", skiprows=1)
# Optional flags
m = self.length_filter(m)
o = self.length_filter(o)
if self.opts.n_seqs!=None:
m = self.subsample_seqs( m )
o = self.subsample_seqs( o )
# Pull out values
self.ids = m[:,0].astype("str")
self.lens = m[:,1].astype("int")
self.mscores = m[:,2:].astype("float")
if self.opts.seq_type=="contig":
self.covs = o[:,2].astype("float")
self.covcomps = o[:,2:].astype("float")
self.comps = o[:,3:].astype("float")
else:
self.comps = o[:,2:].astype("float")
评论列表
文章目录