Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Python interface to C paired-end version, yields malloc issue

  • Loading branch information...
commit 559b8cec3b90dd3ee26edd464265dd9fd78f2101 1 parent 75d625b
@yarden authored
View
49 miso_sampler.py
@@ -903,19 +903,40 @@ def run_sampler(self, num_iters, reads, gene, hyperparameters, params,
# Convert Python Gene object to C
c_gene = py2c_gene(gene)
- # Run C MISO (single-end)
-
- miso_results = pysplicing.MISO(c_gene, 0L,
- tuple([r+1 for r in read_positions]),
- read_cigars,
- long(self.read_len),
- long(num_iters),
- long(burn_in),
- long(lag),
- prior_params)
- print "miso_results: ",
-
- print miso_results
+ ##
+ ## Run C MISO
+ ##
+ read_positions = tuple([r+1 for r in read_positions])
+ if self.paired_end:
+ # Number of standard deviations in insert length
+ # distribution to consider when assigning reads
+ # to isoforms
+ num_sds = 4L
+
+ # Run paired-end
+ miso_results = pysplicing.MISOPaired(c_gene, 0L,
+ read_positions,
+ read_cigars,
+ long(self.read_len),
+ long(self.mean_frag_len),
+ long(self.frag_variance),
+ num_sds,
+ long(num_iters),
+ long(burn_in),
+ long(lag),
+ prior_params)
+ print "PAIRED-END results: "
+ print miso_results
+ else:
+ # Run single-end
+ miso_results = pysplicing.MISO(c_gene, 0L,
+ read_positions,
+ read_cigars,
+ long(self.read_len),
+ long(num_iters),
+ long(burn_in),
+ long(lag),
+ prior_params)
# Psi samples
psi_vectors = transpose(array(miso_results[0]))
@@ -1218,8 +1239,6 @@ def output_miso_results(self, output_file, gene, reads_data, assignments,
# Get a summary of the raw read counts supporting each isoform
read_counts_str = ",".join(read_counts_list)
- print assignments
-
assigned_counts = count_isoform_assignments(assignments)
print "assigned_counts: ", assigned_counts
View
0  test-scripts/recompile_py.sh 100644 → 100755
File mode changed
View
12 test-scripts/test_cver.sh
@@ -8,7 +8,17 @@
#--read-len 36
### C-version
-python /Users/yarden/Projects/fastmiso/MISO/run_miso.py --compute-gene-psi "ENSMUSG00000019943" "/Users/yarden/Projects/fastmiso/MISO/indexed-gff/chr10/ENSMUSG00000019943.pickle" indexed-sam/c2c12.Atp2b1.sorted.bam /Users/yarden/Projects/fastmiso/MISO/test-output --read-len 36 --settings-filename /Users/yarden/Projects/fastmiso/MISO/settings/miso_settings.txt
+rm ~/Projects/fastmiso/MISO/test-output/chr10/ENSMUSG00000019943.miso
+
+# Single-end
+#echo "Testing single-end"
+#python /Users/yarden/Projects/fastmiso/MISO/run_miso.py --compute-gene-psi "ENSMUSG00000019943" "/Users/yarden/Projects/fastmiso/MISO/indexed-gff/chr10/ENSMUSG00000019943.pickle" indexed-sam/c2c12.Atp2b1.sorted.bam /Users/yarden/Projects/fastmiso/MISO/test-output --read-len 36 --settings-filename /Users/yarden/Projects/fastmiso/MISO/settings/miso_settings.txt
+
+rm ~/Projects/fastmiso/MISO/test-output/chr10/ENSMUSG00000019943.miso
+
+# Paired-end
+echo "Testing paired-end"
+python /Users/yarden/Projects/fastmiso/MISO/run_miso.py --compute-gene-psi "ENSMUSG00000019943" "/Users/yarden/Projects/fastmiso/MISO/indexed-gff/chr10/ENSMUSG00000019943.pickle" indexed-sam/c2c12.Atp2b1.sorted.bam /Users/yarden/Projects/fastmiso/MISO/test-output --paired-end 250 30 --read-len 36 --settings-filename /Users/yarden/Projects/fastmiso/MISO/settings/miso_settings.txt
##
Please sign in to comment.
Something went wrong with that request. Please try again.