@@ -282,7 +282,7 @@ def _parse_maverick(self):
282282 # 3. We transpose the array so that each row is a taxon and
283283 # the columns represent the assignment probabilities for each K
284284 mavarray = np .genfromtxt (self .file_path , delimiter = "," ,
285- skip_header = 1 )
285+ skip_header = 1 )
286286 self .qvals = mavarray .T [3 :].T
287287
288288 if self .get_indv :
@@ -546,7 +546,7 @@ def _parse_indfile(self, indfile):
546546
547547 # Populate pops related attributes
548548 for p , pop in enumerate (npops ):
549- # Add population label to list
549+ # Add population label to list
550550 self .pops .append (pop )
551551 self .pops_xpos .append (pop_sums [p ] - pop_counts [pop ] / 2 )
552552 self .pops_xrange .append (
@@ -626,7 +626,7 @@ def plotk(self, kvals, output_dir):
626626 text = ["Assignment: {}%" .format (x * 100 ) for x in i ],
627627 # Customization of bars
628628 marker = dict (
629- #TODO: Only 12 colors supported for now
629+ # TODO: Only 12 colors supported for now
630630 color = c [p ],
631631 line = dict (
632632 color = 'grey' ,
@@ -684,7 +684,7 @@ def plotk(self, kvals, output_dir):
684684 "tickvals" : self .pops_xpos ,
685685 "tickangle" : - 45 ,
686686 "tickfont" : dict (size = 22 ,
687- color = 'black' )}
687+ color = 'black' )}
688688
689689 # Automatic setting of the bottom margin to accomodate larger
690690 # population labels
@@ -696,7 +696,7 @@ def plotk(self, kvals, output_dir):
696696 "mirror" : True ,
697697 "tickangle" : - 45 ,
698698 "tickfont" : dict (size = 14 ,
699- color = 'black' )}
699+ color = 'black' )}
700700
701701 # Automatic setting of the bottom margin to accommodate larger
702702 # individual sample names
@@ -709,9 +709,9 @@ def plotk(self, kvals, output_dir):
709709 fig ["layout" ]["xaxis1" ].update (** xdata )
710710
711711 fig ["layout" ].update (barmode = "stack" ,
712- bargap = 0 ,
713- margin = {"b" : bmargin },
714- legend = {"x" : 1 , "y" : 0.5 })
712+ bargap = 0 ,
713+ margin = {"b" : bmargin },
714+ legend = {"x" : 1 , "y" : 0.5 })
715715
716716 # Determine file name. If a single K value is provided, then
717717 # adapt from the ouptut name of that K value file.
@@ -728,7 +728,7 @@ def plotk(self, kvals, output_dir):
728728 pdiv = plot (fig , include_plotlyjs = False , output_type = 'div' )
729729 # Remove plotly div
730730 pdiv = pdiv .replace (', {"showLink": true, "linkText": '
731- '"Export to plot.ly"}' , '' )
731+ '"Export to plot.ly"}' , '' )
732732
733733 # Create html file
734734 with open (filepath , "w" ) as fh :
@@ -825,6 +825,7 @@ def main(result_files, fmt, outdir, bestk=None, popfile=None, indfile=None):
825825 bestk = [x for x in bestk if x >= 1 ]
826826 klist .plotk (bestk , outdir )
827827
828+
828829if __name__ == "__main__" :
829830 kdir = "/home/diogo/Diogo/Science/PhD/Tasks/Hemileia_RADs/" \
830831 "2_RADs_full/Assembly/ipyrad/Ingroup/Var1/Analyses/" \
0 commit comments