Code Monkey home page Code Monkey logo

liftoverplink's People

Contributors

sritchie73 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

liftoverplink's Issues

Error reading/writing files to lift BED

I'm trying to use liftOverPlink.py and have run into errors that appear to me to be read/writing the files. Below is the output I get when I try running the liftOverPlink.py.

[user@pilotace imputed]$ python liftOverPlink.py --map imputed_chr10_plink_att1.map --out chr10_imputed_hg38_20180114 --chain hg19ToHg38.over.chain.gz --bin /home/user/liftOver
Converting MAP file to UCSC BED file...
SUCC:  map->bed succ
Lifting BED file...
sh: /home/user/liftOver: is a directory
Traceback (most recent call last):
  File "liftOverPlink.py", line 30, in myopen
    h = gzip.open(fn)
  File "/share/apps/python-3.7.1/lib/python3.7/gzip.py", line 53, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/share/apps/python-3.7.1/lib/python3.7/gzip.py", line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'chr10_imputed_hg38_20180114.bed.unlifted'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "liftOverPlink.py", line 172, in <module>
    makesure(liftBed(oldBed, newBed, unlifted, args.chainFile, liftOverPath),
  File "liftOverPlink.py", line 64, in liftBed
    for ln in myopen(params['UNLIFTED']):
  File "liftOverPlink.py", line 34, in myopen
    return open(fn)
FileNotFoundError: [Errno 2] No such file or directory: 'chr10_imputed_hg38_20180114.bed.unlifted'

I'm using python version 3.7.1. No additional files have been added to the directory during the first few steps that seemed to be completed successfully. Any insight that could be given would be greatly appreciated.

Error message at last step

Hi guys,
so, first of all: thanks for this handy tool. I'm trying to liftOver 1000Genomes data to hg38...
I followed your workflow and at the last step: plink --ped lifted.ped --map good_lifted.map --recode --out final I receive an error message from plink:

8472752 (of 8472752) markers to be included from [ good_lifted.map ]

ERROR:
Problem with line 1 in [ lifted.ped ]
Expecting 6 + 2 * 8472752 = 16945510 columns, but found more

So, did anyone of you ever encounter this problem? Can somebody help with it?

Looking forward to your answers.

Cheers, Céline

ValueError: too many values to unpack

To reproduce in R:

download.file("https://raw.githubusercontent.com/sritchie73/liftOverPlink/master/liftOverPlink.py",
              destfile = (liftOverPlink <- tempfile(fileext = ".py")))
Sys.chmod(liftOverPlink, mode = (file.info(liftOverPlink)$mode | "111"))
system(liftOverPlink)

download.file("ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19/liftOver/hg19ToHg18.over.chain.gz", 
              destfile = (chain <- tempfile(fileext = ".over.chain.gz")))

download.file("http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/liftOver",
              destfile = (liftOver <- tempfile()))
Sys.chmod(liftOver, mode = (file.info(liftOver)$mode | "111"))
system(liftOver)

download.file("https://raw.githubusercontent.com/gabraham/flashpca/master/HapMap3/data.bim",
              destfile = (map <- tempfile(fileext = ".map")))

system(glue::glue(
  "python {liftOverPlink} --map {map} --out lifted --chain {chain} --bin {liftOver}"))
# Converting MAP file to UCSC BED file...
# Traceback (most recent call last):
#   File "/tmp/RtmpvNn7Lv/file64416daa6283.py", line 160, in <module>
#     makesure(map2bed(args.mapFile, oldBed),
#   File "/tmp/RtmpvNn7Lv/file64416daa6283.py", line 42, in map2bed
#     chrom, rs, mdist, pos = ln.split()
# ValueError: too many values to unpack
  
system("python --version")
# Python 2.7.5

Chromosome X?

Would it be possible to include functionality to liftover variants from chromosome X?

xrange - Ped

I have an error occurring:
File "liftOverPlink.py", line 110, in liftPed
f=f[:6] + [ f[I2] + ' '+f[I2+1] for I in xrange(3,l/2)]
NameError: name 'xrange' is not defined

The only time 'xrange' occurs in the program is on line 110.

Any ideas how to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.