Skip to content

Commit

Permalink
Added whitelist abundance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Elizabeth Wyman committed Nov 1, 2019
1 parent aa1dbaa commit cbd9577
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
5,28
723,1744
37 changes: 34 additions & 3 deletions testing_suite/test_abundance_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,42 @@ def test_base_settings(self):
print(data)
assert list(data.columns) == ["gene_ID", "transcript_ID",
"annot_gene_id",
"annot_transcript_id", "annot_gene_name",
"annot_transcript_name",
"n_exons",
"annot_transcript_id", "annot_gene_name",
"annot_transcript_name", "n_exons",
"length", "gene_novelty",
"transcript_novelty",
"ISM_subtype",
"PB65_B017", "PB65_B018", "D12"]
assert data.shape[0] == 15

def test_with_whitelist(self):
""" Test abundance utility with a transcript whitelist """
database = "scratch/chr11_and_Tcf3.db"
whitelist = "input_files/chr11_and_Tcf3/testing_whitelist.txt"
try:
subprocess.check_output(
["talon_abundance", "--db", database,
"-a", "gencode_vM7",
"-b", "mm10",
"--whitelist", whitelist,
"--o", "scratch/chr11_and_Tcf3_whitelist"])
except:
pytest.fail("Talon abundance crashed on whitelist case")

# Now check the correctness of the abundance file
abd = "scratch/chr11_and_Tcf3_whitelist_talon_abundance_filtered.tsv"
data = pd.read_csv(abd, sep="\t", header = 0)

print(data)
assert list(data.columns) == ["gene_ID", "transcript_ID",
"annot_gene_id",
"annot_transcript_id", "annot_gene_name",
"annot_transcript_name", "n_exons",
"length", "gene_novelty",
"transcript_novelty",
"ISM_subtype",
"PB65_B017", "PB65_B018", "D12"]
assert set(data.transcript_ID) == set([28,1744])
assert int(data.loc[data['transcript_ID'] == 28]['PB65_B017']) == 1
assert int(data.loc[data['transcript_ID'] == 28]['PB65_B018']) == 0
assert int(data.loc[data['transcript_ID'] == 28]['D12']) == 0

0 comments on commit cbd9577

Please sign in to comment.