Example #1
0
    def _composeBoundingRegionLine(self, boundingRegionTuple):
        region = copy(boundingRegionTuple.region)

        if self._headerDict["1-indexed"]:
            region.start = region.start + 1 if region.start is not None else None
            region.end = region.end + 1 if region.end is not None else None
        if self._headerDict["end inclusive"]:
            region.end = region.end - 1 if region.end is not None else None

        brLinePartList = [
            (Gtrack.convertNameToGtrack(attr), getattr(region, attr)) for attr in ["genome", "chr", "start", "end"]
        ]
        return (
            "####"
            + "; ".join(
                k + "=" + self._formatPhraseWithCorrectChrUsage(str(v), useUrlEncoding=True, notAllowedChars="=;#\t")
                for k, v in brLinePartList
                if v is not None
            )
            + os.linesep
        )
Example #2
0
 def _getGtrackColumnsFromHbColumns(self, hbColumns):
     return [Gtrack.convertNameToGtrack(col) for col in hbColumns if col != "weights"]