billgreenwald / pgltools

Paired Genomic Loci Tool Suite
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

pgltools formatbedpe add trailing tab in the end #4

Closed crazyhottommy closed 6 years ago

crazyhottommy commented 6 years ago
cat -A myfile.pgl
chrX^I100040000^I100041800^IchrX^I99892988^I99896988$
chrX^I100046800^I100048000^IchrX^I99892988^I99896988$
chrX^I100128800^I100130000^IchrX^I99892988^I99896988$
chrX^I99749000^I99751000^IchrX^I99892988^I99896988$
chrX^I99851000^I99853000^IchrX^I99892988^I99896988$
chrX^I99854000^I99856200^IchrX^I99892988^I99896988$
chrX^I99858800^I99859600^IchrX^I99892988^I99896988$
chrX^I99863600^I99865600^IchrX^I99892988^I99896988$
chrX^I99866800^I99867800^IchrX^I99892988^I99896988$
chrX^I99868400^I99868600^IchrX^I99892988^I99896988$

pgltools formatbedpe | cat -A
chrX^I99749000^I99751000^IchrX^I99892988^I99896988^I$
chrX^I99851000^I99853000^IchrX^I99892988^I99896988^I$
chrX^I99854000^I99856200^IchrX^I99892988^I99896988^I$
chrX^I99858800^I99859600^IchrX^I99892988^I99896988^I$
chrX^I99863600^I99865600^IchrX^I99892988^I99896988^I$
chrX^I99866800^I99867800^IchrX^I99892988^I99896988^I$
chrX^I99868400^I99868600^IchrX^I99892988^I99896988^I$
chrX^I99892988^I99896988^IchrX^I100040000^I100041800^I$
chrX^I99892988^I99896988^IchrX^I100046800^I100048000^I$
chrX^I99892988^I99896988^IchrX^I100128800^I100130000^I$

Thanks, Tommy

billgreenwald commented 6 years ago

good catch. I updated the code to fix this issue; can you give it a try and let me know if it works now?

crazyhottommy commented 6 years ago

Thanks for the fix. I will try. BTW, the python API does not have the sort function?

Python 2.7.12 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import PyGLtools as pygl
>>> help(pygl.merge)

>>> help(pygl.sort)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'sort'
billgreenwald commented 6 years ago

The API does have a sort, but it is named pyglSort.

This is to avoid collision from someone doing

from PyGLtools import *

and then having two functions named "sort" in the same namespace, rather than the recommended

import PyGLtools as pygl

I have updated the readme to reflect this.

crazyhottommy commented 6 years ago

thanks!