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

Fail to write VCF file - negative coordinates #29

Open
eudesbarbosa opened this issue Sep 20, 2022 · 3 comments
Open

Fail to write VCF file - negative coordinates #29

eudesbarbosa opened this issue Sep 20, 2022 · 3 comments

Comments

@eudesbarbosa
Copy link

Issue
For a couple of my samples I had problems while writing the MEIs to VCF, negative coordinate issue. Library kit: 'Agilent SureSelect Human All Exon V8'. Could you please help me deal with this issue?

scramble.sh --ref /path/to/hs37d5.fa --out-name /path/to/targeted_seq_mei_calling/work/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1/out/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1 --cluster-file /path/to/targeted_seq_mei_calling/work/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1/out/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1_cluster.txt --nCluster 5 --mei-score 50 --indel-score 80 --poly-a-frac 0.75 --eval-meis
Running sample: /path/to/targeted_seq_mei_calling/work/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1/out/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1_cluster.txt
Running scramble with options:
INSTALL.DIR : /path/to/targeted_seq_mei_calling/.snakemake/conda/9154f892d04f9bfe82a4d010855d834d/share/scramble/bin
blastRef : /path/to/hs37d5.fa
clusterFile : /path/to/targeted_seq_mei_calling/work/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1/out/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1_cluster.txt
deletions : FALSE
indelScore : 80
mei.refs : /path/to/targeted_seq_mei_calling/.snakemake/conda/9154f892d04f9bfe82a4d010855d834d/share/scramble/resources/MEI_consensus_seqs.fa
meiScore : 50
meis : TRUE
minDelLen : 50
nCluster : 5
no.vcf : FALSE
outFilePrefix : /path/to/targeted_seq_mei_calling/work/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1/out/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1
pctAlign : 90
polyAFrac : 0.75
polyAdist : 100
Useful Functions Loaded
Loading required package: BiocGenerics

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colnames, dirname, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
    pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
    tapply, union, unique, unsplit, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    I, expand.grid, unname

Loading required package: IRanges
Loading required package: XVector
Loading required package: GenomeInfoDb

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

Done analyzing l1
Done analyzing sva
Done analyzing alu
Done analyzing l1
Done analyzing sva
Done analyzing alu
Sample had 38 MEI(s)
Done analyzing MEIs
Writing VCF file to /path/to/targeted_seq_mei_calling/work/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1/out/bwa.scramble.<SAMPLE_ID>-N1-DNA1-WES1.vcf...
Error in .Call2("C_solve_user_SEW", refwidths, start, end, width, translate.negative.coord,  :
  solving row 1: 'allow.nonnarrowing' is FALSE and the supplied start (0) is < 1
Calls: write.scramble.vcf ... make_IRanges_from_windows_args -> solveUserSEW -> .Call2
@minn333
Copy link

minn333 commented Oct 16, 2022

I got the same error messages for many files:

Writing VCF file to $PATH/${SampleName}.scramble.vcf...
Error in .Call2("C_solve_user_SEW", refwidths, start, end, width, translate.negative.coord, :
solving row 1: 'allow.nonnarrowing' is FALSE and the supplied start (0) is < 1
Calls: write.scramble.vcf ... make_IRanges_from_windows_args -> solveUserSEW -> .Call2
Execution halted

@zyha
Copy link

zyha commented Mar 17, 2023

Hey,
I believe this happens when MEI is detected at 0th position of the chromosome. We can interpret the nucleotide before the first in the chromosome as 'N'. It resolved after I added the following code in the make.vcf.R

if (start == 0) return('N')
add to this function
get_refs = function(fa, chrom, start, end){ if (start == 0) return('N') ... }

@minn333
Copy link

minn333 commented Mar 19, 2023 via email

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

3 participants