Skip to content

Commit

Permalink
fix bug and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangrengang committed Nov 10, 2023
1 parent 190ede7 commit a53ed05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ Input custom feature (e.g. transposable element, gene) sequences for subgenome-s
```
subphaser -i genome.fasta.gz -c sg.config -custom_features TEs.fasta genes.fasta
```
Define custom colors for subgenomes:
```
subphaser -i genome.fasta.gz -c sg.config -colors "#f9c00c,#00b9f1,#7200da"
```
### Run SubPhaser through Singularity/Apptainer ###
Alternatively, you can run `subphaser` through Singularity/Apptainer container:
```
Expand Down
2 changes: 1 addition & 1 deletion subphaser/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, datafile, n_clusters, sg_prefix='SG', sg_color=None,
self.d_sg = self.assign_subgenomes()
if bootstrap:
self.d_bs = self.bootstrap(replicates, jackknife)
def pca(self, outfig, n_components=2, ):
def pca(self, outfig, n_components=2, sg_color=None):
pca = PCA(n_components=n_components)
X_pca = pca.fit_transform(self.data)
percent = pca.explained_variance_ratio_ * 100
Expand Down
4 changes: 2 additions & 2 deletions subphaser/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def makeArgparse():
help="Output directory [default=%(default)s]")
group_out.add_argument('-tmpdir', default='tmp', type=str, metavar='DIR',
help="Temporary directory [default=%(default)s]")
group_out.add_argument('-colors', default=None, dest='colors', metavar='HEX,HEX...',
help="Subgenome colors [default=%(default)s]")
group_out.add_argument('-colors', default=None, dest='colors', metavar='HEX,HEX[,...]',
help="Subgenome colors in hex codes [default=%(default)s]")

# kmer
group_kmer = parser.add_argument_group('Kmer', 'Options to count and filter kmers')
Expand Down
4 changes: 3 additions & 1 deletion subphaser/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def colors_rgb(self):
return [','.join(map(str, v.bitmap_rgb())) for v in colors_lst]
@property
def colors_r(self):
return 'c({})'.format(','.join(map(repr, self.olors_hex)))
return 'c({})'.format(','.join(map(repr, self.colors_hex)))
def __str__(self):
return str(self.colors_hex)

class Colors:
def __init__(self, n):
Expand Down

0 comments on commit a53ed05

Please sign in to comment.