Re: Sorting of bar plot

908 views
Skip to first unread message

Julie Hebert

unread,
Mar 17, 2013, 11:15:12 AM3/17/13
to structure...@googlegroups.com
Andreas,
Two comments: to do this in distruct, you have to make every individual a "population" then adjust your pop, mainparam, and label files accordingly.
To sort in Excel, you'll need to do some manual sorting. Start with, say, the first column and sort highest to lowest. Starting around where the first column values drop below 0.5, sort again by the next column you want to sort by,etc. It really is much easier in distruct, plus once you have your files set up, if you have to change anything (e.g., rerun the analysis), you can often just tweak the input files to adjust.
Julie

On Monday, March 11, 2013 11:10:55 AM UTC-4, Andreas M. wrote:
Hi all,

somehow I don't get happy with the bar plot outputs.

I would like to get a plot that is sorted by Q and shows me the identifier of the individuals on the x axis. I've tried different ways, also with distruct.

Now I am trying to create a bar plot with MS Excel. It works fine for me when I import the Q-matrix for individuals and create a stacked bar chart.

However, I cannot properly sort the individuals by Q like it is implemented in STRUCTURE. Does anyone have an idea which criteria I have to look at and how I could manage this in Excel?

Thanks in advance!

Best regards
Andreas

Nadya

unread,
Apr 28, 2014, 3:41:29 PM4/28/14
to structure...@googlegroups.com
Hi Julie (or whomever may be able to comment on this),

I am running into an issue similar to Andreas. I would like to display my samples by Q in Distruct in the same manner that they are displayed by Q in Structure (the bar plots look different between the two programs). It would be nice to have the individual sample identifier below the plot as well. I may be misinterpreting your advice to make every individual a population, and perhaps this is not applicable to my issue. If it is, do you mean that in my initial datafile that I run through structure, distinguish each sample as an individual population? Then run structure for K = the number of populations distinguished in the data file or the realistic range of K? I assume this is the way that it would need to be done in order to obtain the population and individual frequencies for distruct.

I have attached a document containing images of my visual output to give you an idea of what I am trying to figure out.

Thank you ahead of time!!!!!

Nadya
Distruct Question.docx

Vikram Chhatre

unread,
Apr 28, 2014, 7:10:33 PM4/28/14
to structure-software
I suggest you follow Julie's method for desired output.  Note that in her answer, the 'mainparams' she is referring to is actually called 'drawparams'.  Hope that resolves the confusion.

V


--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.
To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.

Tahir Ali

unread,
May 11, 2014, 7:31:49 PM5/11/14
to structure...@googlegroups.com
Hi, I also want to sort bar plots according to individual Q's within each defined population and tried to follow the tips given earlier in the discussion but could not get this working for me.



A: by making every individual a population means:

1: modify STRUCTURE input file where every individual should be considered from different population and the run the structure.

2: or means to modify output file of CLUMPP "*.indoutfile" and use as *.popq for Distruct, (2+K columns, where first column giving number of populations, next K columns giving membership coefficient, and last column showing number of ind in each population as "1") and print pop q's by changing drawparams as:
"define PRINT_INDIVS 0 // (B) 1 if indiv q's are to be printed, 0 if only population q's"

But this way I am getting exactly same plot as for individual q's. Confused :(

Best,

Ali

Ramesh krishnan Ramasamy

unread,
May 11, 2014, 10:44:00 PM5/11/14
to structure...@googlegroups.com
Have you sorted Q matrix based on this previous discussion? Show us your plot and Q matrix for better understanding of your question.

Tahir Ali

unread,
May 12, 2014, 5:11:20 AM5/12/14
to structure...@googlegroups.com
Hi Ramesh,

                 Here, I am sending barplot, and orginal individual Q-matrix "K16.indivq" and another file where I treated every individual as population and tried to sort K columns in descending order (that basically I couldn't do).

Thank you for you help.

Best, 
Ali
> To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.

>
>
> To post to this group, send email to structure...@googlegroups.com.
>
> Visit this group at http://groups.google.com/group/structure-software.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.
Barplots and the troubles with sorting it according to individual Qs.pdf
K16.indivq
modified_K16indivq-to-K16.popq

Ramesh krishnan Ramasamy

unread,
May 12, 2014, 5:36:50 AM5/12/14
to structure...@googlegroups.com
The problem is, you didn't sorted your Q matrix. I sorted your Q matrix and attached with this mail. Let us know, you face any other difficulties.

Good luck
Ramesh


To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.



--
Ramesh Krishnan R
Research Scholar
Molecular Biology Laboratory - 1
Central Sericultural Research & Training Institute
Ministry of  Textiles, Govt. of India
Srirampura, Manadavadi road
Mysore - 570 008

Mobile: +91 8951696997, +91 7502533038
Email: rame...@gmail.com

Sorted_tahir.txt

Tahir Ali

unread,
May 13, 2014, 9:01:00 AM5/13/14
to structure...@googlegroups.com
Dear Ramesh,

     Thank you for the help. I sorted all the K columns for every specific populations and then put them together. Still Barplot looks a bit weird! I have attached barplot here, could you have a look and comment on it. This wavy pattern of looks a bit odd, may it is because I have quite many clusters in my dataset!

Best,

Ali
> To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsubscribe@googlegroups.com.

>
>
> To post to this group, send email to structure...@googlegroups.com.
>
> Visit this group at http://groups.google.com/group/structure-software.
>
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsubscribe@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.
To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.



--
DISTRUCT_K16.png

Ramesh krishnan Ramasamy

unread,
May 13, 2014, 9:09:47 AM5/13/14
to structure...@googlegroups.com
Hello,
Because, you sorted Q matrix for each population and combined. Any reason to sort for each population?


To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.

Tahir Ali

unread,
May 13, 2014, 9:39:17 AM5/13/14
to structure...@googlegroups.com
Hi,

                 Because I still want to track my samples, so that I know where are the samples for particular region/population in whole Barplot. Because, if I will be sorting for the whole columns then samples for every population will get mixed up in the whole barplot, will be very difficult to trace them and make inferences how different haplotypes are distributed among regions. So, I want to keep the samples for each population intact as one set in the barplot.

Ali

--

Ramesh krishnan Ramasamy

unread,
May 13, 2014, 9:44:39 AM5/13/14
to structure...@googlegroups.com
If so, then its fine! As far as I know, there is no other way to play with your graphs. Even though, it looks wavy, it conveys the biological meaning.

Ramesh


> To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

>
>
> To post to this group, send email to structure...@googlegroups.com.
>
> Visit this group at http://groups.google.com/group/structure-software.
>
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.



--
Ramesh Krishnan R
Research Scholar
Molecular Biology Laboratory - 1
Central Sericultural Research & Training Institute
Ministry of  Textiles, Govt. of India
Srirampura, Manadavadi road
Mysore - 570 008

Mobile: +91 8951696997, +91 7502533038
Email: rame...@gmail.com

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.
you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.

Tahir Ali

unread,
May 13, 2014, 10:00:19 AM5/13/14
to structure...@googlegroups.com
Thank you for your help.

Ali
> To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.

>
>
> To post to this group, send email to structure...@googlegroups.com.
>
> Visit this group at http://groups.google.com/group/structure-software.
>
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.



--
Ramesh Krishnan R
Research Scholar
Molecular Biology Laboratory - 1
Central Sericultural Research & Training Institute
Ministry of  Textiles, Govt. of India
Srirampura, Manadavadi road
Mysore - 570 008

Mobile: +91 8951696997, +91 7502533038
Email: rame...@gmail.com

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.

To post to this group, send email to structure...@googlegroups.com.
Visit this group at http://groups.google.com/group/structure-software.
For more options, visit https://groups.google.com/d/optout.

you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-software+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages