本文整理汇总了Python中track.Track.add_params方法的典型用法代码示例。如果您正苦于以下问题:Python Track.add_params方法的具体用法?Python Track.add_params怎么用?Python Track.add_params使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.add_params方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: samples2view
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import add_params [as 别名]
def samples2view(self, samples, view, stranded=False, template="%s_tag",
setColor=False, colorByStrand=True):
self.cpt.add_view(view)
tracktype = view.tracktype
viewtype = view.view
suffix = self.tracktype2suffix(tracktype)
for sample, strand in self.iter_samples(samples, stranded):
samplename = sample
if stranded:
samplename = sample+'_'+strand
basename = template % (samplename,)
self.priority += self.priority_step
track = Track(
tracktype=tracktype,
name='%s%s%s' % (self.name, viewtype, samplename),
url=os.path.join(self.name, basename+'.'+suffix),
shortLabel='%s %s' % (samplename, viewtype),
longLabel="%s %s" % (samplename, viewtype),
priority=self.priority,
)
sys.stderr.write(str(track)+"\n")
if stranded and tracktype == "bigWig" and strand in ("-", "rev"):
track.add_params(negateValues="on")
if tracktype == "bigWig":
track.add_params(maxHeightPixels="100:50:8")
if setColor:
if colorByStrand and strand in self.strand2color:
track.add_params(color=self.strand2color[strand])
else:
idx = samples.index(sample) % len(ExpTrack.COLORS)
track.add_params(color=ExpTrack.COLORS[idx])
view.add_tracks(track)