popgenDK / SATC

Sex assignment through coverage
17 stars 10 forks source link

missing value where TRUE/FALSE needed #5

Open atigano opened 2 years ago

atigano commented 2 years ago

Hi, I've tried to run my dataset through the program using the Shiny app. I get the output for the 'Individuals' and 'Normalized depth plot' tabs but I get 'Error:missing value where TRUE/FALSE needed' from the other tabs. I prepared the input file following your script and it looks ok. Do you have any insights into might be wrong?

GenisGE commented 2 years ago

Hi,

How many individuals and scaffolds do you have? And how do the information in the Individuals and Normalized depth plot looks like? An indicator of potential issues is if the depth in normalized scaffolds is far away form 1 in either any individual (you can check if there are outliers in the Individuals table f you order the min.normalized.norm.scaffold and max.normalized.norm.scaffold) or in the overall normalized depth (bottom plot in the Normalized depth plot). I would try if you haven't to play around a bit with the different filtering/method options.

If you want to share your shiny input file I would be happy to try to find the error, and try to get the shiny to print more informative error messages in the future.

Best, Genis

atigano commented 2 years ago

Hi, I have 36 individuals mapped to a chromosome-level assembly. These are individuals and normalized depth plot image image

These are data from a salmon species. Is it possible this program doesn't work because difference in coverage is not a good predictor of sex chromosomes?

Here I also attach my shiny input file tmp2.idxes.txt

Thanks! Anna

GenisGE commented 2 years ago

Hi Anna,

Thanks for sharing the figures and the file. Yes I think the issue is that your dataset does not work because there are no clear sex scaffolds, is that possible? If I either change the clustering method in the shiny to Hierarchical or use Gaussian with K > 4, the software runs but the resulting plots show the clustering is not working (i.e. it is not finding two clearly delimited groups and also does not find good sex scaffold candidates).

Best, Genis

atigano commented 2 years ago

Makes sense actually! I will try it with bird data in the future. Thank you for looking into the issue. Best, Anna

On Wed, Nov 3, 2021 at 11:12 AM GenisGE @.***> wrote:

Hi Anna,

Thanks for sharing the figures and the file. Yes I think the issue is that your dataset does not work because there are no clear sex scaffolds, is that possible? If I either change the clustering method in the shiny to Hierarchical or use Gaussian with K > 4, the software runs but the resulting plots show the clustering is not working (i.e. it is not finding two clearly delimited groups and also does not find good sex scaffold candidates).

Best, Genis

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/popgenDK/SATC/issues/5#issuecomment-959795676, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJ6ZIZDOTSP2JCCUVR4XADUKF3SFANCNFSM5HE6JT5A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Anna Tigano, Ph.D. Postdoctoral Associate The Ecological and Conservation Genomics Lab University of British Columbia - Okanagan annatigano.weebly.com

suvi93 commented 2 years ago

Hi, I'm getting the same error for the following command - rFilt <- filterScaffold(dat=idx,minLength=1e5,M=5)

Error in if (diff(range(cov)) > 0.3) { : 
  missing value where TRUE/FALSE needed

I'm just trying this on 6 samples. any idea what could be going wrong?

GenisGE commented 2 years ago

Hi,

I think your error could be due to not having any normalizing scaffolds left after scaffold length filtering, how many scaffolds you have and what is the length of the longest ones?

An alternative is that there is some issue with the format of your idxstat files, if you want to share your input files I can check.

Best, Genis

suvi93 commented 2 years ago

Hi, Thanks for your reply. I went back checked my files. so the input files which are directly from idxstats seem to be wrong. the 3rd and 4th column for all my scaffolds is 0. I have ~3.4k scaffolds and the longest one being about ~325Mb and I don't know how idxstats calculated the no. of reads there as 0. Flagstats says I've>95% alignment. No idea what's going wrong. I ran idxstats command as shown on your main page. I'm attaching the file as well.

Thanks, Suvi P24XYF_S1_idxstats.txt