How to use the pypeline.common.fileutils.reroot_path function in Pypeline

To help you get started, we’ve selected a few Pypeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MikkelSchubert / paleomix / nodes / validation.py View on Github external
subtable = table[key]
                except KeyError:
                    subtable = table[key] = [0, 0, 0]        

                if record.flag & 0x40: # first of pair
                    subtable[1] += 1
                elif record.flag & 0x80: # second of pair
                    subtable[2] += 1
                else: # Singleton
                    subtable[0] += 1

            references = bamfile.references
            lengths    = bamfile.lengths

            
        with open(reroot_path(temp, self._outfile), "w") as table_file:
            table_file.write("Group\tChr\tChrLen\tSingle\tFirst\tSecond\n")

            for ((group, tid), subtable) in sorted(table.items()):
                prefix = [group, references[tid], lengths[tid]]
                row    = [str(value) for value in (prefix + subtable)]

                table_file.write("\t".join(row) + "\n")

        move_file(reroot_path(temp, self._outfile), self._outfile)
github MikkelSchubert / paleomix / nodes / validation.py View on Github external
subtable[0] += 1

            references = bamfile.references
            lengths    = bamfile.lengths

            
        with open(reroot_path(temp, self._outfile), "w") as table_file:
            table_file.write("Group\tChr\tChrLen\tSingle\tFirst\tSecond\n")

            for ((group, tid), subtable) in sorted(table.items()):
                prefix = [group, references[tid], lengths[tid]]
                row    = [str(value) for value in (prefix + subtable)]

                table_file.write("\t".join(row) + "\n")

        move_file(reroot_path(temp, self._outfile), self._outfile)
github MikkelSchubert / paleomix / pypeline / nodes / statistics.py View on Github external
def _run(self, _config, temp):
        table = {}
        for filename in self.input_files:
            coverage.read_table(table, filename)

        coverage.write_table(table, reroot_path(temp, self._output_file))
        move_file(reroot_path(temp, self._output_file), self._output_file)
github MikkelSchubert / paleomix / pypeline / nodes / statistics.py View on Github external
def _run(self, _config, temp):
        table = {}
        for filename in self.input_files:
            coverage.read_table(table, filename)

        coverage.write_table(table, reroot_path(temp, self._output_file))
        move_file(reroot_path(temp, self._output_file), self._output_file)