alek0991 / iSAFE

Pinpoints the mutation favored by selection
BSD 3-Clause "New" or "Revised" License
32 stars 11 forks source link

Error when running iSAFE using haps converted using plink2 #19

Open itsmestewart opened 6 months ago

itsmestewart commented 6 months ago

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](https://github.com/alek0991/iSAFE/assets/73900141/bd7c5103-cd52-4083-8ff7-e9e4d38163c5)
alek0991 commented 6 months ago

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 https://github.com/alek0991/iSAFE/issues/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 commented 6 months ago

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 commented 6 months ago

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.