Skip to content
Snippets Groups Projects
Commit 5c9ce3aa authored by Holly Ruess's avatar Holly Ruess
Browse files

fix pool and pseudo

parent 87a7d5d8
1 merge request!12Resolve "Fix Pool and Pseudoreps"
Pipeline #5433 failed with stages
in 5 hours, 35 minutes, and 29 seconds
...@@ -99,6 +99,20 @@ def pool(tag_files, outfile, paired): ...@@ -99,6 +99,20 @@ def pool(tag_files, outfile, paired):
return pooled_filename return pooled_filename
def bedpe_to_tagalign(tag_file, outfile):
'''Convert read pairs to reads into standard tagAlign file.'''
se_tag_filename = outfile + ".tagAlign.gz"
# Convert read pairs to reads into standard tagAlign file
tag_steps = ["zcat -f %s" % (tag_file)]
tag_steps.extend([r"""awk 'BEGIN{OFS="\t"}{printf "%s\t%s\t%s\tN\t1000\t%s\n%s\t%s\t%s\tN\t1000\t%s\n",$1,$2,$3,$9,$4,$5,$6,$10}'"""])
tag_steps.extend(['gzip -cn'])
out, err = utils.run_pipe(tag_steps, outfile=se_tag_filename)
return se_tag_filename
def self_psuedoreplication(tag_file, prefix, paired): def self_psuedoreplication(tag_file, prefix, paired):
'''Make 2 self-psuedoreplicates.''' '''Make 2 self-psuedoreplicates.'''
......
...@@ -46,7 +46,7 @@ def test_pool_and_psuedoreplicate_singleend_human(): ...@@ -46,7 +46,7 @@ def test_pool_and_psuedoreplicate_singleend_human():
design_file = os.path.join(test_output_path, 'ENCSR265ZXX_ppr.tsv') design_file = os.path.join(test_output_path, 'ENCSR265ZXX_ppr.tsv')
assert os.path.exists(design_file) assert os.path.exists(design_file)
design_df = pd.read_csv(design_file, sep="\t") design_df = pd.read_csv(design_file, sep="\t")
assert design_df.shape[0] == 7 assert design_df.shape[0] == 6
@pytest.mark.pairedend_mouse @pytest.mark.pairedend_mouse
...@@ -59,4 +59,4 @@ def test_pool_and_psuedoreplicate_pairedend_mouse(): ...@@ -59,4 +59,4 @@ def test_pool_and_psuedoreplicate_pairedend_mouse():
design_file = os.path.join(test_output_path, 'ENCSR451NAE_ppr.tsv') design_file = os.path.join(test_output_path, 'ENCSR451NAE_ppr.tsv')
assert os.path.exists(design_file) assert os.path.exists(design_file)
design_df = pd.read_csv(design_file, sep="\t") design_df = pd.read_csv(design_file, sep="\t")
assert design_df.shape[0] == 6 assert design_df.shape[0] == 5
...@@ -17,9 +17,9 @@ def test_cross_plot_singleend_human(): ...@@ -17,9 +17,9 @@ def test_cross_plot_singleend_human():
def test_cross_qc_singleend_human(): def test_cross_qc_singleend_human():
qc_file = os.path.join(test_output_path,"ENCLB622FZX/ENCLB622FZX.cc.qc") qc_file = os.path.join(test_output_path,"ENCLB622FZX/ENCLB622FZX.cc.qc")
df_xcor = pd.read_csv(qc_file, sep="\t", header=None) df_xcor = pd.read_csv(qc_file, sep="\t", header=None)
assert df_xcor[2].iloc[0] == '0' assert df_xcor[2].iloc[0] == 0
assert df_xcor[8].iloc[0] == 1.347895 assert round(df_xcor[8].iloc[0],6) == 1.332028
assert df_xcor[9].iloc[0] == 1.970438 assert df_xcor[9].iloc[0] == 2.152459
@pytest.mark.pairedend_mouse @pytest.mark.pairedend_mouse
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment