Skip to content

Commit

Permalink
BUG: faith PD vector retains #SampleID index name
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgehret committed Jul 2, 2024
1 parent 6bc66e3 commit 2695b22
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions q2_diversity_lib/alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ def faith_pd(table: BIOMV210Format, phylogeny: NewickFormat,
vec = AlphaDiversityFormat()
cmd = ['faithpd', '-i', str(table), '-t', str(phylogeny), '-o', str(vec)]
_omp_cmd_wrapper(threads, cmd)

# this is needed to prevent #SampleID from being retained as the
# index name in the faith PD vector
# (consistent with the other diversity outputs)
df = pd.read_csv(str(vec), sep='\t')
df.set_index('#SampleID', inplace=True)
df.index.name = None
df.to_csv(str(vec), sep='\t', header=True)

return vec


Expand Down

0 comments on commit 2695b22

Please sign in to comment.