Skip to content

Commit

Permalink
v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinggerm committed Jun 11, 2019
1 parent f78ef67 commit 757639b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions GetOrganelleLib/assembly_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2440,14 +2440,16 @@ def weighted_mean_and_std_np_free(values, weights):
return mean, std


def get_graph_coverages_range_simple(fasta_matrix, drop_low_percent=0.10, drop_high_percent=0.40):
def get_graph_coverages_range_simple(fasta_matrix, drop_low_percent=0.10, drop_high_percent=0.40, drop_ssr=True):
coverages = []
lengths = []
for fastg_name in fasta_matrix[0]:
this_coverage = float(fastg_name.split('cov_')[1].split(':')[0].split(';')[0].split('\'')[0])
this_length = int(fastg_name.split('length_')[1].split('_cov_')[0])
coverages.append(this_coverage)
lengths.append(this_length)
for go_seq, fastg_name in enumerate(fasta_matrix[0]):
# remove sequences like "ATATATATATAT", "AGAGAGAGAGAGAG"
if not (drop_ssr and len(set(fasta_matrix[1][go_seq])) < 3):
this_coverage = float(fastg_name.split('cov_')[1].split(':')[0].split(';')[0].split('\'')[0])
this_length = int(fastg_name.split('length_')[1].split('_cov_')[0])
coverages.append(this_coverage)
lengths.append(this_length)
weights = [inside_cov * lengths[go_v] for go_v, inside_cov in enumerate(coverages)]
sum_weights = sum(weights)
assert drop_low_percent + drop_high_percent < 1
Expand Down

0 comments on commit 757639b

Please sign in to comment.