Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running iSAFE using haps converted using plink2 #19

Open
itsmestewart opened this issue Apr 6, 2024 · 3 comments
Open

Error when running iSAFE using haps converted using plink2 #19

itsmestewart opened this issue Apr 6, 2024 · 3 comments

Comments

@itsmestewart
Copy link

itsmestewart commented Apr 6, 2024

Can I run iSAFE using a vcf file on the entire chromosome?

Second, I tried to run iSafe on the haps file after converting the vcf containing phased data to haps by plink2.
But I ended up getting an error, as shown below.

File "/home/miniconda3/envs/iSafe/bin/isafe", line 10, in
sys.exit(run())
^^^^^
File "/home/miniconda3/envs/iSafe/lib/python3.12/site-packages/isafe/isafe.py", line 185, in run
total_window_size = POS.max() - POS.min()
~~~~~~~~~~^~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'str' and 'str

What could be the reason for this error?

Also, I want to scan selection loci using iSAFE on the entire chromosome without specifying a specific region. How can I use iSAFE for this purpose?

my input file looks like this

image

@itsmestewart itsmestewart changed the title Error when running iSFE using haps converted using plink2 Error when running iSAFE using haps converted using plink2 Apr 6, 2024
@alek0991
Copy link
Owner

alek0991 commented Apr 6, 2024

Hi,

The current implementation of iSAFE is unable to process the entire genome. Many selection scan tools, such as those listed at slescan, are designed for this purpose. However, I have addressed a similar question in #6, which details how to use iSAFE for this purpose. A similar approach was used in Colomer-Vilaplana et al. 2022.

Could you please share a small example of your input along with the error so that I can replicate it?

Best,
Ali

@itsmestewart
Copy link
Author

itsmestewart commented Apr 9, 2024

Dear Alex, I appreciate you for getting back to me so quickly.

I am sorry my question seems to basic. I truly appreciate your assistance.

I will also consider dividing the chromosomes into chunks. Thank you for the recommendation

Yes, I was running this command per chromosome.

isafe --input file1.hap --output file1 --format hap, with default setting.
My input file looks like this: ( This was obtained after converting phased vcf to haps by plink2 with little modification into ISAFE format
image

This is an error I was getting.

File "/home/miniconda3/envs/iSafe/bin/isafe", line 10, in
sys.exit(run())
^^^^^
File "/home/miniconda3/envs/iSafe/lib/python3.12/site-packages/isafe/isafe.py", line 185, in run
total_window_size = POS.max() - POS.min()

TypeError: unsupported operand type(s) for -: 'str' and 'str

@alek0991
Copy link
Owner

alek0991 commented Apr 9, 2024

The error is occurring because the POS variable contains string values instead of numeric values, and the subtraction operation is not supported between strings. Please ensure all POS values are numeric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants