Skip to content

Commit

Permalink
Merge pull request #47 from 4dn-dcic/0.3.0
Browse files Browse the repository at this point in the history
0.3.0
  • Loading branch information
carlvitzthum authored Oct 4, 2017
2 parents 54f361e + 6d6bc71 commit 98f235e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,18 @@ ulimit -n 2000

## Version history

### 0.3.0
* The problem with `fragment_4dnpairs.pl` of adding an extra column is now fixed.
* Fixed bug with 1D querying on 2D data.

### 0.2.9
* `pairix` can now take 1D query for 2D data. e.g.) `pairix file.gz 'chr22:50000-60000'` is equivalent to `pairix file.gz 'chr22:50000-60000|chr22:50000-60000'` if file.gz is 2D indexed.

### 0.2.8
* `pairix` now has option `-a` (autoflip) that flips the query in case the matching chromosome pair doesn't exist in the file.
* `pairix` now has option `-W` that prints out region split character use for indexing a specific file.
* `merge-pairs.sh` is now included in `util`.
* ~`pairix` can now take 1D query for 2D data. e.g.) `pairix file.gz 'chr22:50000-60000'` is equivalent to `pairix file.gz 'chr22:50000-60000|chr22:50000-60000'` if file.gz is 2D indexed.~  This one currently does not work.
* ~`pairix` can now take 1D query for 2D data. e.g.) `pairix file.gz 'chr22:50000-60000'` is equivalent to `pairix file.gz 'chr22:50000-60000|chr22:50000-60000'` if file.gz is 2D indexed.~  This one currently does not work.

### 0.2.6
* Two utils are added: `duplicate_header_remover.pl` and `column_remover.pl` for pairs file format correction.
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.9
0.3.0
2 changes: 1 addition & 1 deletion src/pairix.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef __TABIDX_H
#define __TABIDX_H

#define PACKAGE_VERSION "0.2.9"
#define PACKAGE_VERSION "0.3.0"

#include <stdint.h>
#include "kstring.h"
Expand Down
18 changes: 9 additions & 9 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
4DN: chr1[1] pos1[2] chr2[3] pos2[4]
"""


from __future__ import unicode_literals
import unittest
import gzip
import sys
Expand Down Expand Up @@ -150,17 +150,17 @@ def get_result(regions, chrom, start, end):

def get_result_2D(regions, chrom, start, end, chrom2, start2, end2):
retval = []
for r in regions:
if r[0] == chrom and overlap1(r[1], r[2], start, end) and r[3] == chrom2 and overlap1(r[4], r[5], start2, end2):
retval.append(r)
for reg in regions:
if reg[0] == chrom and overlap1(reg[1], reg[2], start, end) and reg[3] == chrom2 and overlap1(reg[4], reg[5], start2, end2):
retval.append(reg)
return retval


def get_result_2D_4DN(regions, chrom, start, end, chrom2, start2, end2):
def get_result_1D_on_2D(regions, chrom, start, end, chrom2, start2, end2):
retval = []
for r in regions:
if r[1] == chrom and overlap1(r[2], r[2], start, end) and r[3] == chrom2 and overlap1(r[4], r[4], start2, end2):
retval.append(r)
for reg in regions:
if reg[0] == chrom and overlap1(reg[2], reg[2], start, end) and reg[3] == chrom2 and overlap1(reg[4], reg[4], start2, end2):
retval.append(reg)
return retval


Expand Down Expand Up @@ -409,7 +409,7 @@ class PairixTest_1_on_2(unittest.TestCase):
chrom2 = chrom
start2 = start
end2 = end
result = get_result_2D_4DN(regions, chrom, start, end, chrom2, 0, sys.maxsize)
result = get_result_1D_on_2D(regions, chrom, start, end, chrom2, start2, end2)
pr = pypairix.open(TEST_FILE_2D_4DN_2)

def test_querys(self):
Expand Down
6 changes: 3 additions & 3 deletions util/fragment_4dnpairs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
elsif($headers[$i] eq 'frag2') { $frag2_colindex=$i-1; }
}
print STDERR "$frag1_colindex, $frag2_colindex\n"; # Soo
if($frag1_colindex == -1) { $frag1_colindex=$#headers+1; print OUTFILE "$_ frag1\n"; next; }
elsif($frag2_colindex == -1) { $frag2_colindex=$#headers+1; print OUTFILE "$_ frag2\n"; next; }
if($frag1_colindex == -1) { $frag1_colindex=$#headers; print OUTFILE "$_ frag1\n"; next; }
elsif($frag2_colindex == -1) { $frag2_colindex=$#headers; print OUTFILE "$_ frag2\n"; next; }
else { print OUTFILE "$_\n"; next; }
}
else { $frag1_colindex=$#headers+1; $frag2_colindex=$#headers+2; print OUTFILE "$_ frag1 frag2\n"; next; }
else { $frag1_colindex=$#headers; $frag2_colindex=$#headers+1; print OUTFILE "$_ frag1 frag2\n"; next; }
}
elsif(/^#/) { print OUTFILE "$_\n"; next; }
my @original_record = split;
Expand Down

0 comments on commit 98f235e

Please sign in to comment.