David Parsons pushed to branch master at Debian Med / bcalm


Commits:
678808d3 by David Parsons at 2020-08-20T15:55:45+02:00
New upstream version

- - - - -
81349d42 by David Parsons at 2020-08-20T15:57:55+02:00
New upstream version 2.2.3
- - - - -
e3608b16 by David Parsons at 2020-08-20T15:57:56+02:00
Update upstream source from tag 'upstream/2.2.3'

Update to upstream version '2.2.3'
with Debian dir 79d3cde47411d000efea5d665f6bcaef7e4dd751
- - - - -


4 changed files:

- VERSION
- bidirected-graphs-in-bcalm2/bidirected-graphs-in-bcalm2.md
- debian/changelog
- + scripts/abundance_stats.py


Changes:

=====================================
VERSION
=====================================
@@ -1 +1 @@
-v2.2.2
+v2.2.3


=====================================
bidirected-graphs-in-bcalm2/bidirected-graphs-in-bcalm2.md
=====================================
@@ -8,7 +8,7 @@ There are several ways of representing bi-directed graphs. Here 
we describe the
 
 ![Fig1](fig1.png)
 
-Note that we draw the fromSign next to the "from" vertex, and the toSign next 
to the "to" vertex. In other words, the following graph is equivalent to the 
one above:
+Note that we draw the fromSign next to the "from" vertex, and the toSign next 
to the "to" vertex. In other words, the following two graph are equivalent:
 
 ![Fig2](fig2.png)
 


=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+bcalm (2.2.3-1) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * New upstream version
+
+ -- David Parsons <[email protected]>  Thu, 20 Aug 2020 15:53:06 +0200
+
 bcalm (2.2.2-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.


=====================================
scripts/abundance_stats.py
=====================================
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+import sys, os
+if len(sys.argv) < 2:
+    print("prints some abundance statitics of a unitigs FASTA file produced by 
BCALM")
+    exit("arguments: unitigs.fa")
+
+# https://www.biostars.org/p/710/#1412
+from itertools import groupby
+def fasta_iter(fasta_name):
+    """
+    given a fasta file. yield tuples of header, sequence
+    """
+    fh = open(fasta_name)
+    # ditch the boolean (x[0]) and just keep the header or sequence since
+    # we know they alternate.
+    faiter = (x[1] for x in groupby(fh, lambda line: line[0] == ">"))
+    for header in faiter:
+        # drop the ">"
+        header = next(header)[1:].strip()
+        # join all sequence lines to one.
+        seq = "".join(s.strip() for s in next(faiter))
+        yield header, seq
+
+unitigs = sys.argv[1]
+abundances = []
+from collections import defaultdict
+totsize = defaultdict(int)
+for header, unitig in fasta_iter(unitigs):
+    for field in header.split():
+        if field.startswith("km:f:"):
+            abundance = field.split(":")[-1]
+            #print(abundance)
+            abundance = int(float(abundance)) # convert to rounded int
+            abundances += [abundance]
+            totsize[abundance] += len(unitig)
+
+from collections import Counter
+c = Counter(abundances)
+print("'value' : 'number of unitigs having this mean abundance value' : 'total 
size of unitigs having this mean abundance'")
+for val in sorted(list(c)):
+    print(val,":",c[val],':',totsize[val])
+



View it on GitLab: 
https://salsa.debian.org/med-team/bcalm/-/compare/2a99c72d4e727391850da2870b97863223f42dd0...e3608b160becaccdd7b069de9ff18ba5ecad5fa3

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/bcalm/-/compare/2a99c72d4e727391850da2870b97863223f42dd0...e3608b160becaccdd7b069de9ff18ba5ecad5fa3
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to