wangmi811 / RPASE

The package RPASE (Read-backed Phasing-based ASE detection) implements an algorithm for identifying genes which show allele-specific expression (ASE) on a per-individual and per-gene basis, using RNA-seq read count data.
3 stars 1 forks source link

creatPhasedBlockList results in subscript out of bounds error #1

Closed AndrewLangvt closed 5 years ago

AndrewLangvt commented 5 years ago

I'm trying to use RPASE to analyze an RNA-Seq dataset for ASE. I followed the methods in your paper (2-pass mapping with STAR, variant calling with GATK, and read-backed phasing with GATK). I'm now attempting to run RPASE, but it seems there is an issue somewhere in the generation of the PhasedBlockList, indicating the subscript is out of bounds when attempting to try.split.accoring.index[[i]]. I am guessing line 12 of filterPhasedBlockList, but not positive. Any thoughts? I've included the first 10 lines of my vcf and annotation files, as well as the error. I have compared my VCF and annotation files to the example ones you provide, yet I cannot identify any glaring differences.

VCF

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  blk0-x_female_gonad_m-n2
CM007525.1      12463   .       C       T       87.77   PASS    AC=1;AF=0.500;AN=2;BaseQRankSum=0.000;ClippingRankSum=0.000;DP=4;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.000;QD=21.94;ReadPosRankSum
CM007525.1      12531   .       T       C       192.84  PASS    AC=2;AF=1.00;AN=2;DP=6;ExcessHet=3.0103;FS=0.000;MLEAC=2;MLEAF=1.00;MQ=60.00;QD=32.14;SOR=2.303 GT:AD:DP:GQ:PL  1/1:0,6:6:18:221,18,0
CM007525.1      17989   .       C       CCAATCAGGAGCT   33.71   PASS    AC=2;AF=1.00;AN=2;DP=2;ExcessHet=3.0103;FS=0.000;MLEAC=2;MLEAF=1.00;MQ=60.00;QD=16.85;SOR=0.693 GT:AD:DP:GQ:PL  1/1:0,2:2:6:70,6,0
CM007525.1      68093   .       T       C       392.77  PASS    AC=2;AF=1.00;AN=2;DP=13;ExcessHet=3.0103;FS=0.000;MLEAC=2;MLEAF=1.00;MQ=60.00;QD=30.21;SOR=1.179        GT:AD:DP:GQ:PL  1/1:0,13:13:42:421,42,0
CM007525.1      68115   .       C       T       30.77   PASS    AC=1;AF=0.500;AN=2;BaseQRankSum=1.732;ClippingRankSum=0.000;DP=9;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.000;QD=3.42;ReadPosRankSum=
CM007525.1      68142   .       G       A       32.77   PASS    AC=1;AF=0.500;AN=2;BaseQRankSum=0.319;ClippingRankSum=0.000;DP=10;ExcessHet=3.0103;FS=3.332;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.000;QD=4.10;ReadPosRankSum
CM007525.1      68236   .       C       T       51.77   PASS    AC=1;AF=0.500;AN=2;BaseQRankSum=-1.175;ClippingRankSum=0.000;DP=28;ExcessHet=3.0103;FS=2.066;MLEAC=1;MLEAF=0.500;MQ=60.00;MQRankSum=0.000;QD=2.25;ReadPosRankSu
CM007525.1      68366   .       G       A       445.77  PASS    AC=2;AF=1.00;AN=2;BaseQRankSum=2.055;ClippingRankSum=0.000;DP=14;ExcessHet=3.0103;FS=5.441;MLEAC=2;MLEAF=1.00;MQ=60.00;MQRankSum=0.000;QD=31.84;ReadPosRankSum=
CM007525.1      68712   .       A       C       309.77  PASS    AC=2;AF=1.00;AN=2;DP=13;ExcessHet=3.0103;FS=0.000;MLEAC=2;MLEAF=1.00;MQ=60.00;QD=23.83;SOR=1.179        GT:AD:DP:GQ:PL  1/1:0,13:13:39:338,39,0

Annotation

chromosome      gene.start      gene.end        gene.name
KV878007.1      288414  343784  102086538
KV878007.1      374138  416208  102086538
KV878007.1      492168  536183  110362900
KV878007.1      590484  603088  102087652
KV878007.1      530017  566837  102086120
KV878007.1      599091  621797  102085936
KV878007.1      625166  655971  102085761
KV878007.1      760402  778051  102085155
KV878007.1      738393  753992  102085334

ERROR

> library(RPASE)
> library("vcfR")
> the.vcf <- read.vcfR("~/Desktop/blk0-x_female_gonad_m-n2_phased.vcf")
Scanning file to determine attributes.
File attributes:
  meta lines: 95
  header_line: 96
  variant count: 169724
  column count: 10
Meta line 95 read in.
All meta lines processed.
gt matrix initialized.
Character matrix gt created.
  Character matrix gt rows: 169724
  Character matrix gt cols: 10
  skip: 0
  nrows: 169724
  row_num: 0
Processed variant: 169724
All variants processed
> phased_vcf <- cbind(the.vcf@fix, the.vcf@gt)
> annotation <- read.csv("~/Desktop/Rockdove_cliv2.RPASE.tsv", sep = "\t", header = TRUE)
> phased_block_list_sample <- createPhasedBlockList(phased_vcf, annotation)
Error in try.split.accoring.index[[i]] : subscript out of bounds
In addition: There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
2: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
3: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
4: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
5: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
6: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
7: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
8: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
9: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
10: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
11: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
12: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
13: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
14: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
15: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
16: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
17: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
18: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
19: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
20: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
21: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
22: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
23: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
24: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
25: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
26: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
27: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
28: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
29: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
30: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
31: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
32: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
33: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
34: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
35: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
36: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
37: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
38: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
39: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
40: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
41: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
42: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
43: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
44: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
45: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
46: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
47: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
48: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
49: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors
50: In Ops.factor(vcf.sca$position, end) : ‘<’ not meaningful for factors
> 
AndrewLangvt commented 5 years ago

I found the source of my error. When reading in the VCF with vcfR, I had to convert it to a data frame, and then reset the POS and QUAL columns to be integer and numeric, respectfully.

the.g.vcf <- read.vcfR("~/Desktop/blk0-x_female_gonad_m-n2.phased.vcf")
phased_gvcf_df <- as.data.frame(cbind(the.g.vcf@fix, the.g.vcf@gt))
phased_gvcf <- transform(phased_gvcf_df, POS = as.numeric(POS), QUAL = as.numeric(QUAL))

annotation <- read.csv("~/Desktop/Rockdove_cliv2.RPASE.tsv", sep = "\t", header = TRUE)
colnames(annotation) <- c("chromosome", "gene.start", "gene.end", "gene.name")

phased_block_list <- createPhasedBlockList(phased_gvcf, annotation)

phi.estimate(phased_block_list)
runRPASE(phased_block_list, phi=0.77576, quiet=FALSE)

Runs without issue now! Can't wait to see the results :-D

douglasgscofield commented 5 years ago

Great, glad to hear it!

Neither Mi nor I have had a chance to look at this yet, but the error "1: In Ops.factor(star, vcf.sca$position) : ‘<’ not meaningful for factors" made me think there might have been an inadvertent conversion away from numeric in the vcf. It's a "feature" of reading data into R data frames that can be frustrating if missed.

On Wed, 9 Jan 2019 at 22:49, AndrewLangvt notifications@github.com wrote:

I found the source of my error. When reading in the VCF with vcfR, I had to convert it to a data frame, and then reset the POS and QUAL columns to be integer and numeric, respectfully.

the.g.vcf <- read.vcfR("~/Desktop/blk0-x_female_gonad_m-n2.phased.vcf") phased_gvcf_df <- as.data.frame(cbind(the.g.vcf@fix, the.g.vcf@gt)) phased_gvcf <- transform(phased_gvcf_df, POS = as.numeric(POS), QUAL = as.numeric(QUAL))

annotation <- read.csv("~/Desktop/Rockdove_cliv2.RPASE.tsv", sep = "\t", header = TRUE) colnames(annotation) <- c("chromosome", "gene.start", "gene.end", "gene.name")

phased_block_list <- createPhasedBlockList(phased_gvcf, annotation)

phi.estimate(phased_block_list) runRPASE(phased_block_list, phi=0.77576, quiet=FALSE)

Runs without issue now! Can't wait to see the results :-D

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wangmi811/RPASE/issues/1#issuecomment-452852994, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkKgriysA7XRcVnu2pEE_VG7-XeDa6Tks5vBl9lgaJpZM4Zz73o .

AndrewLangvt commented 5 years ago

Can either of you provide a brief overview of the GATK processing you utilized? I know your publication indicates you followed GATKs best practices for RNAseq processing and read-backed phasing, but I'm having a hard time generating a VCF that will work with all aspects of RPASE.

Here's what I've done thus far, that I'm confident in from following GATKs "best practices"

AddOrReplaceReadGroups
MarkDuplicates
SplitNCigarReads

Following this, I think you probably used HaplotypeCaller in GVCF mode, as that generates an output with phasing, and also has the ref, alt, alt read depth provided that the filterPhasedBlockList sub function of createPhasedBlockList requires, while HaplotypeCaller in "normal" VCF mode followed by ReadBackedPhasing does not generate such a VCF.

My question is this... you must have done some form of variant filtration, as you end up with the PASS in the FILTER column, but do you at some point run the GVCF through GenotypeGVCFs? Or is your workflow solely HaplotypeCaller in GVCF mode and VariantFiltering? I ask because, when I proceed directly from HaplotypeCaller in GVCF to VariantFiltering, I end up with numerous warnings...

WARN  11:45:28,497 Interpreter - ![0,2]: 'QD < 2.0;' undefined variable QD 
WARN  11:45:28,497 Interpreter - ![0,2]: 'FS > 30.0;' undefined variable FS

From GATK documentation, these are simply due to a lack of annotation at that site. My concern is there are a LOT (hundreds) of these warnings when I only conduct VariantFiltering, and far, far fewer (4) when I perform VariantFiltering after GenotypeGVCFs, though, as I mentioned, the GenotypeGVCFs output does not read through the filterPhasedBlockList sub function of createPhasedBlockList correctly.

Any thoughts?

AndrewLangvt commented 5 years ago

Any thoughts here? I've run through the GVCF option with haplotypecaller and filtered using GATKs best practices but RPASE won't fully process the phased block list and it returns the following error

Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : 
  invalid 'times' value

I've tried to identify any ways my phased block list might be different from your example one, though I cannot find any differences.

> library(vcfR)
> library(RPASE)
> the.g.vcf <- read.vcfR("~/Desktop/RPASE_testing/y97-x_female_pituitary_n9.HTcall.filtered.phasedONLY.g.vcf")
Scanning file to determine attributes.
File attributes:
  meta lines: 157
  header_line: 158
  variant count: 95549
  column count: 10
Meta line 157 read in.
All meta lines processed.
gt matrix initialized.
Character matrix gt created.
  Character matrix gt rows: 95549
  Character matrix gt cols: 10
  skip: 0
  nrows: 95549
  row_num: 0
Processed variant: 95549
All variants processed
> phased_gvcf_df <- as.data.frame(cbind(the.g.vcf@fix, the.g.vcf@gt))
> phased_gvcf <- transform(phased_gvcf_df, POS = as.integer(POS), QUAL = as.numeric(QUAL))
> annotation <- read.csv("~/Desktop/RPASE_testing/Rockdove_cliv2.RPASE.tsv", sep = "\t", header = TRUE)
> colnames(annotation) <- c("chromosome", "gene.start", "gene.end", "gene.name")
> phased_block_list <- createPhasedBlockList(phased_gvcf, annotation)
> phi.estimate(phased_block_list)
[1] 0.1
Warning messages:
1: In stats::nlm(ELIKE1, p = 0.1, hessian = T) :
  NA/Inf replaced by maximum positive value
2: In stats::nlm(ELIKE1, p = 0.1, hessian = T) :
  NA/Inf replaced by maximum positive value
3: In stats::nlm(ELIKE1, p = 0.1, hessian = T) :
  NA/Inf replaced by maximum positive value
4: In stats::nlm(ELIKE1, p = 0.1, hessian = T) :
  NA/Inf replaced by maximum positive value
> runRPASE(phased_block_list, phi=0.1, quiet=FALSE)
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : 
  invalid 'times' value
> data("example_phased_block_list")
> sapply(example_phased_block_list, class)
     GeneA.1      GeneA.2      GeneB.1      GeneC.1      GeneD.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
> sapply(phased_block_list, class)
 102083405.1  102083411.1  102083435.1  102083588.1  102083626.1  102083687.1  102083720.1  102083765.1  102083900.1  102084082.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102084174.1  102084818.1  102085005.1  102085047.1  102085116.1  102085186.1  102085225.1  102085296.1  102085509.1  102085545.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102085574.1  102085692.1  102085727.1  102085827.1  102085868.1  102086003.1  102086071.1  102086083.1  102086112.1  102086192.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102086234.1  102086297.1  102086375.1  102086562.1  102086564.1  102086606.1  102086613.1  102086750.1  102086884.1  102086942.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102086944.1  102087060.1  102087071.1  102087250.1  102087375.1  102087421.1  102087432.1  102087672.1  102087889.1  102088031.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102088306.1  102088331.1  102088388.1  102088393.1  102088489.1  102088501.1  102088574.1  102088636.1  102088659.1  102088662.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102088685.1  102088705.1  102088756.1  102088765.1  102088807.1  102088846.1  102088938.1  102088949.1  102089041.1  102089134.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102089223.1  102089238.1  102089322.1  102089329.1  102089333.1  102089511.1  102089698.1  102089886.1  102090067.1  102090236.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102090285.1  102090469.1  102090479.1  102090690.1  102090871.1  102091052.1  102091557.1  102091665.1  102091749.1  102091928.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102092024.1  102092066.1  102092109.1  102092197.1  102092255.1  102092288.1  102092422.1  102092468.1  102092603.1  102092622.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102092649.1  102092807.1  102092836.1  102093023.1  102093108.1  102093205.1  102093244.1  102093389.1  102093817.1  102093982.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102094132.1  102094167.1  102094277.1  102094444.1  102094683.1  102094821.1  102094869.1  102095136.1  102095166.1  102095265.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102095289.1  102095357.1  102095414.1  102095451.1  102095475.1  102095508.1  102095697.1  102095847.1  102095914.1  102095926.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102096184.1  102096347.1  102096443.1  102096446.1  102096610.1  102096628.1  102096631.1  102096791.1  102096811.1  102096814.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102096973.1  102096987.1  102097246.1  102097478.1  102097486.1  102098248.1  102098326.1  102098423.1  102098447.1  102098525.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 102098724.1  102098752.1  102098786.1  102098806.1  102098905.1  102098974.1  104075811.1  104076163.1  104829988.1  105406017.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 105409414.1  105415938.1  106145936.1  106146048.1  106885523.1  106900130.1  110358860.1  110358973.1  110360066.1  110360093.1 
"data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" "data.frame" 
 110360980.1 
"data.frame" 
> typeof(example_phased_block_list$GeneA.1)
[1] "list"
> typeof(phased_block_list$`102083405.1`)
[1] "list"
> example_phased_block_list
$GeneA.1
  scaffold position index    gene AD1 AD2
1    chr01    21500     1 GeneA.1  52  27
2    chr01    21530     1 GeneA.1  48  25
3    chr01    21560    -1 GeneA.1  17   7

$GeneA.2
  scaffold position index    gene AD1 AD2
1    chr01    24500     1 GeneA.2  62   4
2    chr01    24550     1 GeneA.2  66   3

$GeneB.1
  scaffold position index    gene AD1 AD2
1    chr01    10500     1 GeneB.1  31  30
2    chr01    10550    -1 GeneB.1  32  34

$GeneC.1
  scaffold position index    gene AD1 AD2
1    chr03   255500     1 GeneC.1  14   5
2    chr03   255520     1 GeneC.1  15   4
3    chr03   255550     1 GeneC.1  16   3
4    chr03   255570     1 GeneC.1  15   3
5    chr03   255600    -1 GeneC.1  14   4
6    chr03   255660    -1 GeneC.1  16   3
7    chr03   255700     1 GeneC.1  16   3

$GeneD.1
  scaffold position index    gene AD1 AD2
1    chr14  1360500     1 GeneD.1  29  22
> phased_block_list
$`102098905.1`
        scaffold position index        gene AD1 AD2
28958 CM007532.1    88892     1 102098905.1  22  27
28987 CM007532.1    90088     1 102098905.1   3   7
28996 CM007532.1    91087     1 102098905.1  19  19
28997 CM007532.1    91088     1 102098905.1  18  15
28998 CM007532.1    91103     1 102098905.1   6   4
29004 CM007532.1    91139     1 102098905.1  16   5
29005 CM007532.1    91140     1 102098905.1  16   5
29006 CM007532.1    91180     1 102098905.1  27  16
29007 CM007532.1    91181     1 102098905.1  30  18
29008 CM007532.1    91208     1 102098905.1  50  26
29009 CM007532.1    91209     1 102098905.1  45  35
29022 CM007532.1    92628     1 102098905.1  30  19
29023 CM007532.1    92629     1 102098905.1  34  17
29028 CM007532.1    93617     1 102098905.1  10   4
29029 CM007532.1    93624     1 102098905.1  10   4

$`102098974.1`
        scaffold position index        gene AD1 AD2
54817 KV878006.1    25287     1 102098974.1  15   3
54818 KV878006.1    25288     1 102098974.1  15   3
54825 KV878006.1    38280     1 102098974.1  25  17

$`104075811.1`
       scaffold position index        gene AD1 AD2
1262 CM007524.1     3641     1 104075811.1  47   4
1263 CM007524.1     3663     1 104075811.1  58   4
1289 CM007524.1     8668     1 104075811.1  75   3
1292 CM007524.1     8678     1 104075811.1 423   8
1293 CM007524.1     8679     1 104075811.1 418  31
1294 CM007524.1     8680     1 104075811.1 357 158
1295 CM007524.1     8681     1 104075811.1 334 166
1297 CM007524.1     8683     1 104075811.1 448 173
1298 CM007524.1     8684     1 104075811.1 190   7
1299 CM007524.1     8685     1 104075811.1 176  23
1300 CM007524.1     8688     1 104075811.1 315  90
1301 CM007524.1     8689     1 104075811.1 358  50
1302 CM007524.1     8693     1 104075811.1 330  60
1303 CM007524.1     8694     1 104075811.1 348  97
1312 CM007524.1     8708     1 104075811.1 230  16
1313 CM007524.1     8709     1 104075811.1 221  15
1324 CM007524.1     8969     1 104075811.1  23   6
1325 CM007524.1     8970     1 104075811.1  23   6
1326 CM007524.1     8971     1 104075811.1  21   7
1329 CM007524.1     8987     1 104075811.1  10   6
1330 CM007524.1     8988     1 104075811.1  10   6
1331 CM007524.1     8989     1 104075811.1  14   3
1343 CM007524.1    10245     1 104075811.1  80   4
1344 CM007524.1    10246     1 104075811.1  82   4
1345 CM007524.1    10247     1 104075811.1  44   5
1346 CM007524.1    10248     1 104075811.1  44   5
1347 CM007524.1    10253     1 104075811.1  51  19
1348 CM007524.1    10254     1 104075811.1  53   8
1351 CM007524.1    10257     1 104075811.1  11  17
1352 CM007524.1    10258     1 104075811.1  13  17
1353 CM007524.1    10261     1 104075811.1  20   3
AndrewLangvt commented 5 years ago

I've honed in on the error a bit further. It seems that the phased block list generated for my data contains some "blocks" that RPASE can process, while other ones throw errors... I'm really at a loss as to why some of the output from createPhasedBlockList can be processed by the RPASE function, while others cannot... The only thing I can come up with is that RPASE isn't able to handle the larger phased blocks...

I'm not concerned with the Error: vector memory exhausted (limit reached?) as I know I simply need to ask for more memory. My concern is the alternating Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value error.

> RPASE(phased_block_list2[[1]], phi=0.1)
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : 
  invalid 'times' value
> phased_block_list2[[1]]
        scaffold position index        gene AD1 AD2
16537 CM007528.1    29068     1 102083405.1  18  12
16538 CM007528.1    29069     1 102083405.1  18  15
16555 CM007528.1    31727     1 102083405.1   6   5
16556 CM007528.1    31729     1 102083405.1   6   5
16561 CM007528.1    34389     1 102083405.1   5  12
16562 CM007528.1    34390     1 102083405.1   5  12
16587 CM007528.1    35908     1 102083405.1  41  30
16588 CM007528.1    35909     1 102083405.1  41  30
16590 CM007528.1    35911     1 102083405.1   6   4
16592 CM007528.1    35913     1 102083405.1   3   9
16595 CM007528.1    35918     1 102083405.1  38  36
16596 CM007528.1    35919     1 102083405.1  35  30
16609 CM007528.1    35970     1 102083405.1  98  94
16610 CM007528.1    35971     1 102083405.1 109 127
16619 CM007528.1    36046     1 102083405.1   7   3
16623 CM007528.1    36104     1 102083405.1  34  22
16624 CM007528.1    36105     1 102083405.1  33  21
16625 CM007528.1    36108     1 102083405.1  69  34
16626 CM007528.1    36109     1 102083405.1  65  33
16639 CM007528.1    36163     1 102083405.1  12   3
16640 CM007528.1    36164    -1 102083405.1   7  11
16642 CM007528.1    36325     1 102083405.1  10   3
16643 CM007528.1    36327     1 102083405.1   8   5
16644 CM007528.1    36328     1 102083405.1   8   5
16645 CM007528.1    36330     1 102083405.1  30  10
16647 CM007528.1    36336     1 102083405.1   8   4
16649 CM007528.1    36338     1 102083405.1  12   4
16650 CM007528.1    36339     1 102083405.1  12   4
16651 CM007528.1    36348     1 102083405.1  12   7
16652 CM007528.1    36350     1 102083405.1  10   4
16665 CM007528.1    36728     1 102083405.1  90  24
16666 CM007528.1    36729     1 102083405.1  70  30
16667 CM007528.1    36734     1 102083405.1  44   6
16668 CM007528.1    36735     1 102083405.1  46   8
16669 CM007528.1    36738     1 102083405.1   8   4
16670 CM007528.1    36739     1 102083405.1   7   3
16683 CM007528.1    36844     1 102083405.1   9   8
16684 CM007528.1    36855     1 102083405.1  48  10
16685 CM007528.1    36856     1 102083405.1  47   8
16698 CM007528.1    36884     1 102083405.1  37  14
16699 CM007528.1    36885     1 102083405.1  39  16
16702 CM007528.1    36892     1 102083405.1   6   6
16712 CM007528.1    36981     1 102083405.1  12   3
16713 CM007528.1    36982     1 102083405.1  11   7
16716 CM007528.1    37217     1 102083405.1   6   6
16717 CM007528.1    37218     1 102083405.1   6   6
16730 CM007528.1    37442     1 102083405.1  19   7
16731 CM007528.1    37443     1 102083405.1  14   9
16732 CM007528.1    37447     1 102083405.1  13   7
16733 CM007528.1    37448     1 102083405.1  13   7
16734 CM007528.1    37451     1 102083405.1  22   6
16735 CM007528.1    37452     1 102083405.1  22   7
16736 CM007528.1    37453     1 102083405.1   8   6
16737 CM007528.1    37454     1 102083405.1   8   3
16740 CM007528.1    37639     1 102083405.1   4  12
16741 CM007528.1    37640     1 102083405.1   3  12
16744 CM007528.1    37696     1 102083405.1   6   4
16745 CM007528.1    37697     1 102083405.1   7   4
16746 CM007528.1    37700     1 102083405.1   8   6
16747 CM007528.1    37701     1 102083405.1   8   6
16748 CM007528.1    37781     1 102083405.1  15   8
16749 CM007528.1    37782     1 102083405.1  16   8
16764 CM007528.1    38112     1 102083405.1   6   6
16765 CM007528.1    38113     1 102083405.1   8   4
16766 CM007528.1    38120     1 102083405.1   5   7
16767 CM007528.1    38121     1 102083405.1   5   7
16769 CM007528.1    38123     1 102083405.1   7   5
16771 CM007528.1    38125     1 102083405.1   7   4
16772 CM007528.1    38126     1 102083405.1   5   5
16775 CM007528.1    38147     1 102083405.1   3   9
16777 CM007528.1    38149    -1 102083405.1   3  11
16778 CM007528.1    38150     1 102083405.1   9  12
16779 CM007528.1    38151     1 102083405.1  12  11
16780 CM007528.1    38154     1 102083405.1   7   7
16781 CM007528.1    38155     1 102083405.1   7   7
16783 CM007528.1    38157     1 102083405.1   7   3
16784 CM007528.1    38178     1 102083405.1  12   4
16785 CM007528.1    38179     1 102083405.1  11   4
16812 CM007528.1    38859     1 102083405.1   6   8
16819 CM007528.1    38916     1 102083405.1   6   6
16820 CM007528.1    38917     1 102083405.1   6   6
16831 CM007528.1    39040     1 102083405.1   8   6
16832 CM007528.1    39041     1 102083405.1   8   6
16845 CM007528.1    39124     1 102083405.1  11   4
16846 CM007528.1    39125     1 102083405.1  10   4
16862 CM007528.1    39261     1 102083405.1  21  17
16863 CM007528.1    39262     1 102083405.1  21  17
16866 CM007528.1    39356     1 102083405.1  10  11
16867 CM007528.1    39357     1 102083405.1  10  12
16892 CM007528.1    40118     1 102083405.1  79  43
16894 CM007528.1    40122     1 102083405.1  11   4
16895 CM007528.1    40123     1 102083405.1  11   4
16896 CM007528.1    40124     1 102083405.1  10  10
16897 CM007528.1    40125     1 102083405.1  10  10
16900 CM007528.1    40128     1 102083405.1  11   4
16901 CM007528.1    40129     1 102083405.1  10   3
16917 CM007528.1    40166     1 102083405.1   8   4
16935 CM007528.1    40427     1 102083405.1  26  21
16936 CM007528.1    40428     1 102083405.1  23  21
16937 CM007528.1    40429     1 102083405.1  13   6
16938 CM007528.1    40430     1 102083405.1  13   6
16960 CM007528.1    41371     1 102083405.1  15   7
16961 CM007528.1    41372     1 102083405.1  15   5
16963 CM007528.1    41374     1 102083405.1  14   3
16964 CM007528.1    41375     1 102083405.1   6   7
16966 CM007528.1    41377     1 102083405.1  14   3
16967 CM007528.1    41378     1 102083405.1  14   3
16983 CM007528.1    41957     1 102083405.1  26  12
16984 CM007528.1    41958     1 102083405.1  23  10
16986 CM007528.1    41963     1 102083405.1   9   3
16997 CM007528.1    41993     1 102083405.1  30  19
16998 CM007528.1    41994     1 102083405.1  32  18
16999 CM007528.1    41997     1 102083405.1  29  17
17000 CM007528.1    41998     1 102083405.1  27  17
17005 CM007528.1    42008     1 102083405.1  10  13
17006 CM007528.1    42009     1 102083405.1  21   3
17007 CM007528.1    42010     1 102083405.1  12  10
17009 CM007528.1    42021     1 102083405.1  34  28
17010 CM007528.1    42022     1 102083405.1  35  29
17013 CM007528.1    42040     1 102083405.1  41  17
17014 CM007528.1    42041     1 102083405.1  41  23
17023 CM007528.1    42231     1 102083405.1   8  14
17024 CM007528.1    42232     1 102083405.1   8  15
17025 CM007528.1    42233     1 102083405.1  12   9
17026 CM007528.1    42234     1 102083405.1  12  12
17028 CM007528.1    42236     1 102083405.1  16  14
17049 CM007528.1    42913     1 102083405.1  20  30
17050 CM007528.1    42914     1 102083405.1  17  31
17051 CM007528.1    42915     1 102083405.1  41   9
17052 CM007528.1    42916     1 102083405.1  38  12
17063 CM007528.1    42961     1 102083405.1  39  18
17064 CM007528.1    42962     1 102083405.1  42  15
17065 CM007528.1    42963     1 102083405.1   5   5
17072 CM007528.1    42978     1 102083405.1   7   4
17073 CM007528.1    42979     1 102083405.1   9   5
17074 CM007528.1    42982     1 102083405.1  18  10
17075 CM007528.1    42983     1 102083405.1  16  10
17076 CM007528.1    42984     1 102083405.1  18  10
17077 CM007528.1    42985     1 102083405.1  17  10
17078 CM007528.1    42986     1 102083405.1  17   7
17079 CM007528.1    42987     1 102083405.1  16   6
17083 CM007528.1    43016     1 102083405.1  35   5
17097 CM007528.1    43446     1 102083405.1  28  27
17098 CM007528.1    43447     1 102083405.1  30  28
17099 CM007528.1    43452     1 102083405.1   9   6
17100 CM007528.1    43453     1 102083405.1  12   7
17116 CM007528.1    43724     1 102083405.1   9  11
17117 CM007528.1    43725     1 102083405.1  12  14
17131 CM007528.1    43898     1 102083405.1  22   7
17132 CM007528.1    43899     1 102083405.1  22   7
17135 CM007528.1    43908     1 102083405.1  19   9
17136 CM007528.1    43909     1 102083405.1  16   8
17137 CM007528.1    43916     1 102083405.1   7   5
17138 CM007528.1    43917    -1 102083405.1   7   5
17145 CM007528.1    43936     1 102083405.1  16  13
17146 CM007528.1    43937     1 102083405.1  17  13
17147 CM007528.1    43946     1 102083405.1  11   5
17148 CM007528.1    43947     1 102083405.1  11   4
17149 CM007528.1    43948     1 102083405.1  11   4
17154 CM007528.1    43958     1 102083405.1  33  22
17155 CM007528.1    43959     1 102083405.1  33  22
17156 CM007528.1    43960     1 102083405.1   6   5
17157 CM007528.1    43961    -1 102083405.1   5   5
17185 CM007528.1    44258    -1 102083405.1  11  18
17194 CM007528.1    44434     1 102083405.1   7   4
17195 CM007528.1    44435     1 102083405.1   8   4
17220 CM007528.1    44554     1 102083405.1  71  25
17221 CM007528.1    44555     1 102083405.1  72  25
17222 CM007528.1    44556     1 102083405.1  66  93
17223 CM007528.1    44557    -1 102083405.1  63  97
17226 CM007528.1    44564     1 102083405.1   7   3
17231 CM007528.1    44573     1 102083405.1   9   8
17238 CM007528.1    44586     1 102083405.1  11   4
17239 CM007528.1    44587     1 102083405.1  11   4
> RPASE(phased_block_list2[[2]], phi=0.1)
Error: vector memory exhausted (limit reached?)
> phased_block_list2[[2]]
        scaffold position index        gene AD1 AD2
47651 CM007546.1    69191     1 102083411.1  28  19
47652 CM007546.1    69192    -1 102083411.1  26  25
47653 CM007546.1    69196     1 102083411.1  19   6
47655 CM007546.1    69198     1 102083411.1  18   4
47656 CM007546.1    69199     1 102083411.1  19   5
47663 CM007546.1    69420     1 102083411.1  14   4
47664 CM007546.1    69422     1 102083411.1  14   3
47665 CM007546.1    69450     1 102083411.1   4   9
47666 CM007546.1    69451    -1 102083411.1   4   8
47667 CM007546.1    69459     1 102083411.1  10   7
47668 CM007546.1    69460     1 102083411.1   9   7
47684 CM007546.1    69652     1 102083411.1   7   4
47689 CM007546.1    69682     1 102083411.1  45   8
47690 CM007546.1    69683     1 102083411.1  40   8
47703 CM007546.1    70101     1 102083411.1  32   6
47704 CM007546.1    70102     1 102083411.1  36  11
47705 CM007546.1    70107     1 102083411.1  58  23
47706 CM007546.1    70108     1 102083411.1  58  23
47711 CM007546.1    70321     1 102083411.1  16   7
47712 CM007546.1    70322     1 102083411.1  16   7
47734 CM007546.1    71307     1 102083411.1  48   3
47735 CM007546.1    71308     1 102083411.1  53   3
47740 CM007546.1    71321     1 102083411.1  11   3
> RPASE(phased_block_list2[[3]], phi=0.1)
[1] "102083435.1"          "0.000396658843482488"
[1] 0.0003966588
> phased_block_list2[[3]]
        scaffold position index        gene AD1 AD2
28914 CM007532.1    82975     1 102083435.1  23   4
28915 CM007532.1    82976     1 102083435.1  23   4
28928 CM007532.1    84113     1 102083435.1  23   8
28942 CM007532.1    85584     1 102083435.1  26   7
28943 CM007532.1    85585     1 102083435.1  26   7
> RPASE(phased_block_list2[[4]], phi=0.1)
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : 
  invalid 'times' value
> phased_block_list2[[4]]
        scaffold position index        gene AD1 AD2
17606 CM007528.1    65871     1 102083588.1  33  41
17607 CM007528.1    65872     1 102083588.1  29  28
17643 CM007528.1    66182     1 102083588.1  19   9
17653 CM007528.1    66216     1 102083588.1   9   3
17654 CM007528.1    66217     1 102083588.1   8   3
17655 CM007528.1    66218     1 102083588.1   5   6
17656 CM007528.1    66219     1 102083588.1   5   6
17689 CM007528.1    67252     1 102083588.1  14  13
17693 CM007528.1    67266     1 102083588.1  11  12
17717 CM007528.1    67404     1 102083588.1  19  10
17718 CM007528.1    67405     1 102083588.1  15   7
17719 CM007528.1    67418     1 102083588.1  27  21
17720 CM007528.1    67419     1 102083588.1  22  16
17756 CM007528.1    67657     1 102083588.1  17   6
17757 CM007528.1    67658     1 102083588.1  17   6
17760 CM007528.1    67758     1 102083588.1  45  13
17761 CM007528.1    67759     1 102083588.1  44  13
17762 CM007528.1    67760     1 102083588.1  53  23
17763 CM007528.1    67761     1 102083588.1  53  20
17764 CM007528.1    67762     1 102083588.1  52  14
17765 CM007528.1    67763     1 102083588.1  50  18
17770 CM007528.1    67780     1 102083588.1  11   3
17773 CM007528.1    67783     1 102083588.1  10   3
17774 CM007528.1    67784     1 102083588.1  17   7
17775 CM007528.1    67785     1 102083588.1  19   8
17776 CM007528.1    67786     1 102083588.1  20  14
17798 CM007528.1    68074    -1 102083588.1  33  17
17801 CM007528.1    68077     1 102083588.1   6   5
17802 CM007528.1    68078    -1 102083588.1   6   8
17803 CM007528.1    68079     1 102083588.1  14   6
17804 CM007528.1    68080     1 102083588.1  14   6
17833 CM007528.1    68211     1 102083588.1  15   3
17834 CM007528.1    68212     1 102083588.1  16   3
17835 CM007528.1    68215     1 102083588.1   8  12
17836 CM007528.1    68216     1 102083588.1   8  12
17837 CM007528.1    68217     1 102083588.1   8   6
17838 CM007528.1    68218     1 102083588.1   8   6
17841 CM007528.1    68222     1 102083588.1  13   3
17842 CM007528.1    68223     1 102083588.1  12   3
17848 CM007528.1    68260     1 102083588.1  50  26
17853 CM007528.1    68289     1 102083588.1  16  12
17854 CM007528.1    68290     1 102083588.1  15  12
17857 CM007528.1    68329     1 102083588.1  33  39
17858 CM007528.1    68330     1 102083588.1  32  43
17859 CM007528.1    68332     1 102083588.1  33  19
17860 CM007528.1    68333    -1 102083588.1  34  20
17863 CM007528.1    68338     1 102083588.1   8   4
17864 CM007528.1    68339     1 102083588.1   9   4
17887 CM007528.1    68972     1 102083588.1  18  10
17888 CM007528.1    68973     1 102083588.1  22  12
17915 CM007528.1    69321     1 102083588.1  22   6
17916 CM007528.1    69322     1 102083588.1  21   6
17922 CM007528.1    69391     1 102083588.1  13   8
17964 CM007528.1    70014     1 102083588.1   6   8
17968 CM007528.1    70067     1 102083588.1   6   4
17969 CM007528.1    70068     1 102083588.1   6   4
17976 CM007528.1    70087     1 102083588.1  10  11
17977 CM007528.1    70088     1 102083588.1   9  13
17978 CM007528.1    70091     1 102083588.1   6   4
17979 CM007528.1    70092     1 102083588.1   7   4
17990 CM007528.1    70135     1 102083588.1  19  26
17991 CM007528.1    70136     1 102083588.1  20  21
17992 CM007528.1    70137    -1 102083588.1  18  22
17993 CM007528.1    70138     1 102083588.1  29   7
17994 CM007528.1    70139     1 102083588.1  28   9
18003 CM007528.1    70152     1 102083588.1   5  13
18004 CM007528.1    70153     1 102083588.1   5  13
18013 CM007528.1    70170     1 102083588.1 140  85
18014 CM007528.1    70171     1 102083588.1 120  29
18015 CM007528.1    70172     1 102083588.1 118  51
18016 CM007528.1    70173     1 102083588.1  88  73
18017 CM007528.1    70174     1 102083588.1  87  53
18031 CM007528.1    70197     1 102083588.1  13   7
18032 CM007528.1    70198    -1 102083588.1  12   9
18033 CM007528.1    70199     1 102083588.1   8   3
18034 CM007528.1    70200     1 102083588.1   7   3
18056 CM007528.1    70272     1 102083588.1  14  17
18057 CM007528.1    70273    -1 102083588.1  15  18
18089 CM007528.1    70373     1 102083588.1  37  22
18090 CM007528.1    70374     1 102083588.1  44  24
18123 CM007528.1    70651     1 102083588.1  41  43
18124 CM007528.1    70652     1 102083588.1  38  42
18125 CM007528.1    70655     1 102083588.1  22  23
18126 CM007528.1    70656     1 102083588.1  21  23
18193 CM007528.1    71735     1 102083588.1   3  30
18201 CM007528.1    71758     1 102083588.1   8  12
18202 CM007528.1    71759     1 102083588.1   9  11
18203 CM007528.1    71760     1 102083588.1  30  10
18204 CM007528.1    71761     1 102083588.1  30   7
18217 CM007528.1    72122     1 102083588.1   8   5
18218 CM007528.1    72123     1 102083588.1   9   6
18219 CM007528.1    72124     1 102083588.1   7   6
18223 CM007528.1    72156     1 102083588.1   6  10
18224 CM007528.1    72157     1 102083588.1   7   9
18228 CM007528.1    72161     1 102083588.1  19   5
18230 CM007528.1    72163     1 102083588.1  14   7
18231 CM007528.1    72164     1 102083588.1  15   6
18275 CM007528.1    72228     1 102083588.1  18   3
18276 CM007528.1    72229    -1 102083588.1  16   5
18293 CM007528.1    72248     1 102083588.1  11  41
18294 CM007528.1    72249     1 102083588.1   9  37
18361 CM007528.1    72346     1 102083588.1   7   3
18401 CM007528.1    72494     1 102083588.1  23   5
18402 CM007528.1    72495     1 102083588.1  22   4
18413 CM007528.1    72507     1 102083588.1  12   3
18415 CM007528.1    72510     1 102083588.1  16   7
18416 CM007528.1    72511     1 102083588.1  16   7
18419 CM007528.1    72516     1 102083588.1  11  16
18420 CM007528.1    72517    -1 102083588.1   9  13
18421 CM007528.1    72518    -1 102083588.1   5  10
18422 CM007528.1    72519     1 102083588.1  10   5
18423 CM007528.1    72520     1 102083588.1  11   5
18424 CM007528.1    72523     1 102083588.1  10   4
18425 CM007528.1    72524     1 102083588.1  10   4
18426 CM007528.1    72525     1 102083588.1   9   6
18447 CM007528.1    72641     1 102083588.1   8   4
18448 CM007528.1    72642     1 102083588.1   8   4
18455 CM007528.1    72667     1 102083588.1  11   7
18456 CM007528.1    72668     1 102083588.1  11   4
18477 CM007528.1    72734     1 102083588.1  16   4
18478 CM007528.1    72735     1 102083588.1  15   7
18479 CM007528.1    72736     1 102083588.1  13  10
18480 CM007528.1    72737     1 102083588.1  12  10
18495 CM007528.1    72860     1 102083588.1  30   5
18496 CM007528.1    72861     1 102083588.1  30   5
18499 CM007528.1    72959     1 102083588.1 144  61
18500 CM007528.1    72960     1 102083588.1 143  54
18502 CM007528.1    72962     1 102083588.1  61  93
18503 CM007528.1    72963     1 102083588.1  66  39
18504 CM007528.1    72964     1 102083588.1  67  39
18505 CM007528.1    72965     1 102083588.1 140  59
18506 CM007528.1    72966     1 102083588.1 128  38
18507 CM007528.1    72967     1 102083588.1  88  40
18508 CM007528.1    72968     1 102083588.1  86  10
18509 CM007528.1    72971     1 102083588.1  92  34
18527 CM007528.1    72997     1 102083588.1  50 177
18528 CM007528.1    72998    -1 102083588.1  48 182
18529 CM007528.1    73001     1 102083588.1  25 113
18530 CM007528.1    73002     1 102083588.1  30 127
18540 CM007528.1    73089     1 102083588.1  16  13
18541 CM007528.1    73090     1 102083588.1  15  12
18542 CM007528.1    73096     1 102083588.1   8  11
18543 CM007528.1    73098     1 102083588.1   6  12
18553 CM007528.1    73144     1 102083588.1  33  20
18555 CM007528.1    73146     1 102083588.1  48  22
18556 CM007528.1    73147     1 102083588.1  45  22
18557 CM007528.1    73148     1 102083588.1  42  29
18558 CM007528.1    73149     1 102083588.1  19   8
18559 CM007528.1    73150     1 102083588.1  20   8
18560 CM007528.1    73151     1 102083588.1  32   3
18567 CM007528.1    73158     1 102083588.1 106 136
18568 CM007528.1    73159    -1 102083588.1  98 135
18571 CM007528.1    73164     1 102083588.1 137 130
18572 CM007528.1    73165     1 102083588.1 139 135
18591 CM007528.1    73414     1 102083588.1  32  16
18592 CM007528.1    73415     1 102083588.1  32  16
18600 CM007528.1    73452     1 102083588.1  11  10
18616 CM007528.1    73500     1 102083588.1   5   6
18617 CM007528.1    73501     1 102083588.1   5   8
18620 CM007528.1    73504     1 102083588.1  14  11
18621 CM007528.1    73505     1 102083588.1   7   4
18624 CM007528.1    73579     1 102083588.1   9   5
18627 CM007528.1    73584     1 102083588.1  11   3
18628 CM007528.1    73585     1 102083588.1  11   3
18636 CM007528.1    73605     1 102083588.1  13   3
18667 CM007528.1    73952     1 102083588.1   5   6
18668 CM007528.1    73953     1 102083588.1   4   6
18671 CM007528.1    73956     1 102083588.1  27  14
18672 CM007528.1    73957     1 102083588.1  29   5
18694 CM007528.1    74479     1 102083588.1   5  10
18695 CM007528.1    74480     1 102083588.1   5  10
18702 CM007528.1    74539     1 102083588.1  18   5
18703 CM007528.1    74540     1 102083588.1  18   8
18718 CM007528.1    74860     1 102083588.1   5   6
18719 CM007528.1    74861     1 102083588.1   5   6
18724 CM007528.1    74866     1 102083588.1   7   3
18725 CM007528.1    74867     1 102083588.1   8   7
18731 CM007528.1    74873     1 102083588.1   5   5
18745 CM007528.1    74957     1 102083588.1   8   4
18756 CM007528.1    75378     1 102083588.1  16   3
18757 CM007528.1    75379     1 102083588.1  16   4
18758 CM007528.1    75380     1 102083588.1  33  24
18759 CM007528.1    75381     1 102083588.1  34  25
 [ reached 'max' / getOption("max.print") -- omitted 33 rows ]
> RPASE(phased_block_list2[[5]], phi=0.1)
Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : 
  invalid 'times' value
> phased_block_list2[[5]]
        scaffold position index        gene AD1 AD2
27281 CM007532.1    34646     1 102083626.1  23   4
27282 CM007532.1    34647     1 102083626.1  23   4
27283 CM007532.1    34648     1 102083626.1  24   5
27284 CM007532.1    34649     1 102083626.1  19   5
27285 CM007532.1    34650     1 102083626.1   7   6
27286 CM007532.1    34651     1 102083626.1   6   6
27287 CM007532.1    34652     1 102083626.1  10  10
27290 CM007532.1    34655    -1 102083626.1   3   8
27291 CM007532.1    34656     1 102083626.1   6  11
27306 CM007532.1    34717     1 102083626.1   8   9
27307 CM007532.1    34718    -1 102083626.1   8  10
27308 CM007532.1    34719     1 102083626.1  15   9
27309 CM007532.1    34720     1 102083626.1  15   8
27310 CM007532.1    34721     1 102083626.1   6   6
27311 CM007532.1    34722    -1 102083626.1   8   8
27314 CM007532.1    34747     1 102083626.1   6  11
27315 CM007532.1    34748     1 102083626.1   6  11
27326 CM007532.1    34779     1 102083626.1  28   9
27327 CM007532.1    34780     1 102083626.1  29  15
27328 CM007532.1    34781     1 102083626.1  51  31
27329 CM007532.1    34782     1 102083626.1  52  31
27330 CM007532.1    34787     1 102083626.1  38  17
27331 CM007532.1    34788     1 102083626.1  39  17
27332 CM007532.1    34793     1 102083626.1  54  27
27346 CM007532.1    34809     1 102083626.1  28  30
27347 CM007532.1    34810    -1 102083626.1  26  31
27350 CM007532.1    34813     1 102083626.1  26  13
27351 CM007532.1    34814     1 102083626.1  26  10
27352 CM007532.1    34815     1 102083626.1  14   9
27353 CM007532.1    34816     1 102083626.1  13  11
27354 CM007532.1    34853     1 102083626.1  34   6
27355 CM007532.1    34854     1 102083626.1  33   6
27367 CM007532.1    34881     1 102083626.1   6   6
27376 CM007532.1    34903     1 102083626.1  39  10
27377 CM007532.1    34904     1 102083626.1  36  10
27378 CM007532.1    34907     1 102083626.1 101  72
27379 CM007532.1    34908     1 102083626.1 108  79
27400 CM007532.1    35569     1 102083626.1   5   7
27401 CM007532.1    35570    -1 102083626.1   5   8
27424 CM007532.1    35707     1 102083626.1   6   6
27425 CM007532.1    35708    -1 102083626.1   3   7
27426 CM007532.1    35716     1 102083626.1   7   7
27428 CM007532.1    35718     1 102083626.1  17   3
27429 CM007532.1    35719     1 102083626.1  17   3
27435 CM007532.1    35743     1 102083626.1  23   6
27436 CM007532.1    35744     1 102083626.1  22   8
27437 CM007532.1    35747     1 102083626.1  26  13
27438 CM007532.1    35748     1 102083626.1  26   9
27439 CM007532.1    35749     1 102083626.1  15  16
27440 CM007532.1    35750     1 102083626.1  12  18
27452 CM007532.1    36009     1 102083626.1  19  15
27453 CM007532.1    36016     1 102083626.1  10   7
27454 CM007532.1    36017     1 102083626.1  10   6
27461 CM007532.1    36032     1 102083626.1  13  13
27462 CM007532.1    36033     1 102083626.1  15  25
27463 CM007532.1    36044     1 102083626.1   9   6
27464 CM007532.1    36045     1 102083626.1   9   6
27476 CM007532.1    36061     1 102083626.1   7   3
27477 CM007532.1    36062     1 102083626.1   8   3
27482 CM007532.1    36073     1 102083626.1  91  11
27483 CM007532.1    36074     1 102083626.1  88  11
27509 CM007532.1    36310     1 102083626.1  39  12
27510 CM007532.1    36311     1 102083626.1  40  15
27511 CM007532.1    36312     1 102083626.1  37   4
27512 CM007532.1    36313     1 102083626.1  34   4
27515 CM007532.1    36443     1 102083626.1  75  38
27516 CM007532.1    36444     1 102083626.1  75  40
27520 CM007532.1    36456     1 102083626.1   6   4
27521 CM007532.1    36468     1 102083626.1  78   3
27522 CM007532.1    36469     1 102083626.1  78   3
27529 CM007532.1    36908     1 102083626.1  41  27
27530 CM007532.1    36909     1 102083626.1  40  28
27531 CM007532.1    36914     1 102083626.1  13   6
27533 CM007532.1    36916     1 102083626.1   8  10
27548 CM007532.1    37033     1 102083626.1   4   7
27549 CM007532.1    37034    -1 102083626.1   4   8
27553 CM007532.1    37099     1 102083626.1  10   8
27554 CM007532.1    37100     1 102083626.1  11   8
27555 CM007532.1    37103     1 102083626.1  13   8
27556 CM007532.1    37104     1 102083626.1   9   5
27557 CM007532.1    37105     1 102083626.1  18   8
27558 CM007532.1    37106     1 102083626.1  21  10
27562 CM007532.1    37205    -1 102083626.1   9   6
27569 CM007532.1    37293     1 102083626.1  19  14
27570 CM007532.1    37294     1 102083626.1  17  12
27572 CM007532.1    37315    -1 102083626.1  23  29
27583 CM007532.1    37364     1 102083626.1  13  20
27584 CM007532.1    37365     1 102083626.1  11  16
27587 CM007532.1    37380     1 102083626.1  23  75
27624 CM007532.1    37614     1 102083626.1   9   3
27625 CM007532.1    37615     1 102083626.1   7   3
27626 CM007532.1    37616     1 102083626.1   3   7
27627 CM007532.1    37617     1 102083626.1   3   7
27632 CM007532.1    37664     1 102083626.1  14  15
27633 CM007532.1    37665     1 102083626.1  13  15
27636 CM007532.1    37668     1 102083626.1  11   4
27637 CM007532.1    37669     1 102083626.1  11   4
27674 CM007532.1    38131     1 102083626.1  11   9
27675 CM007532.1    38132     1 102083626.1  10   8
27680 CM007532.1    38217     1 102083626.1  12   7
27681 CM007532.1    38218     1 102083626.1  12   7
27682 CM007532.1    38219     1 102083626.1  12   7
27683 CM007532.1    38220     1 102083626.1  20  11
27684 CM007532.1    38221     1 102083626.1  21  11
27700 CM007532.1    38347     1 102083626.1  18   9
27705 CM007532.1    38352     1 102083626.1  16   3
27706 CM007532.1    38353     1 102083626.1  16   3
27715 CM007532.1    38480     1 102083626.1   8   5
27716 CM007532.1    38481    -1 102083626.1   8   7
27719 CM007532.1    38484     1 102083626.1  15  12
27720 CM007532.1    38485     1 102083626.1  17   8
27721 CM007532.1    38486     1 102083626.1  13   3
27722 CM007532.1    38487     1 102083626.1  13   3
27723 CM007532.1    38488     1 102083626.1   7   3
27725 CM007532.1    38490     1 102083626.1   8   9
27726 CM007532.1    38491     1 102083626.1   7   6
27727 CM007532.1    38504     1 102083626.1  23  10
27728 CM007532.1    38505     1 102083626.1  24  10
27729 CM007532.1    38506     1 102083626.1  28  14
27730 CM007532.1    38507     1 102083626.1  27   8
27731 CM007532.1    38508     1 102083626.1  17  17
27732 CM007532.1    38509     1 102083626.1  18  16
27733 CM007532.1    38565     1 102083626.1  12   4
27734 CM007532.1    38566     1 102083626.1  11   5
27735 CM007532.1    38573     1 102083626.1  19   7
27736 CM007532.1    38574     1 102083626.1  19   7
27739 CM007532.1    38577     1 102083626.1  16   6
27740 CM007532.1    38578     1 102083626.1  16   4
27743 CM007532.1    38605     1 102083626.1  12   4
27744 CM007532.1    38606     1 102083626.1  13   5
27747 CM007532.1    38720     1 102083626.1  17  17
27748 CM007532.1    38721     1 102083626.1  17  17
27749 CM007532.1    38724     1 102083626.1  19  12
27750 CM007532.1    38725     1 102083626.1  20  12
27788 CM007532.1    39493     1 102083626.1  24   8
27789 CM007532.1    39494     1 102083626.1  22   8
27807 CM007532.1    39861     1 102083626.1   9   6
27808 CM007532.1    39862     1 102083626.1  10   7
27825 CM007532.1    39902     1 102083626.1  10   3
27826 CM007532.1    39903     1 102083626.1   8   3
27832 CM007532.1    39909     1 102083626.1  10   4
27833 CM007532.1    39912     1 102083626.1   6  10
27834 CM007532.1    39913     1 102083626.1   6   8
27837 CM007532.1    39918     1 102083626.1  16   5
27838 CM007532.1    39919     1 102083626.1  16   5
27839 CM007532.1    39920     1 102083626.1  33  14
27840 CM007532.1    39921     1 102083626.1  33  10
27841 CM007532.1    39922     1 102083626.1  29   3
27842 CM007532.1    39923     1 102083626.1  32  11
27845 CM007532.1    39928     1 102083626.1  11   3
27846 CM007532.1    39929     1 102083626.1  12   3
27847 CM007532.1    39930     1 102083626.1  17   9
27848 CM007532.1    39931     1 102083626.1  17   9
27851 CM007532.1    39936     1 102083626.1  33   5
27852 CM007532.1    39937     1 102083626.1  36   5
27853 CM007532.1    39940     1 102083626.1  27   5
27854 CM007532.1    39941     1 102083626.1  27   5
27855 CM007532.1    39942     1 102083626.1  25  15
27856 CM007532.1    39943     1 102083626.1  25  16
27859 CM007532.1    39964     1 102083626.1  29   3
27860 CM007532.1    39965     1 102083626.1  32   3
27861 CM007532.1    40078     1 102083626.1   8  26
27862 CM007532.1    40079    -1 102083626.1   7  26
27863 CM007532.1    40080     1 102083626.1 158 178
27864 CM007532.1    40081    -1 102083626.1 138 192
27866 CM007532.1    40083     1 102083626.1 274 203
27867 CM007532.1    40086     1 102083626.1   9   3
27881 CM007532.1    40249     1 102083626.1  32  30
27882 CM007532.1    40250    -1 102083626.1  35  31
27891 CM007532.1    40285     1 102083626.1  10   5
27892 CM007532.1    40286     1 102083626.1   7   3
27895 CM007532.1    40289     1 102083626.1  12   6
27896 CM007532.1    40290     1 102083626.1  12   7
27899 CM007532.1    40293     1 102083626.1   8   4
27900 CM007532.1    40294     1 102083626.1   8   4
27901 CM007532.1    40295     1 102083626.1   7   5
27907 CM007532.1    40305     1 102083626.1  42  31
27908 CM007532.1    40331     1 102083626.1  13   8
27909 CM007532.1    40332     1 102083626.1  13   6
27910 CM007532.1    40333     1 102083626.1  15   4
27911 CM007532.1    40334     1 102083626.1  15   5
27912 CM007532.1    40341     1 102083626.1  14   8
27913 CM007532.1    40342     1 102083626.1  14   6
 [ reached 'max' / getOption("max.print") -- omitted 143 rows ]
> RPASE(phased_block_list2[[6]], phi=0.1)
Error: vector memory exhausted (limit reached?)
> phased_block_list2[[6]]
        scaffold position index        gene AD1 AD2
55022 KV878011.1     4804     1 102083687.1  32   9
55023 KV878011.1     4805     1 102083687.1  31   6
55026 KV878011.1     4851     1 102083687.1   5   7
55036 KV878011.1     5049     1 102083687.1  36  14
55037 KV878011.1     5050     1 102083687.1  36   8
55038 KV878011.1     5051     1 102083687.1  44  16
55039 KV878011.1     5052     1 102083687.1  44  16
55040 KV878011.1     5063     1 102083687.1   7   3
55041 KV878011.1     5064     1 102083687.1   7   3
55066 KV878011.1     6974     1 102083687.1   4   9
55067 KV878011.1     6975     1 102083687.1   5   9
55090 KV878011.1     8018     1 102083687.1  48  38
55091 KV878011.1     8019    -1 102083687.1  45  41
55104 KV878011.1     8314     1 102083687.1   4   6
55105 KV878011.1     8315     1 102083687.1   5   6
55121 KV878011.1     9593     1 102083687.1   8   8
55122 KV878011.1     9594    -1 102083687.1   8   8
55123 KV878011.1     9595     1 102083687.1  11   9
55124 KV878011.1     9596     1 102083687.1  12   4
55133 KV878011.1     9722     1 102083687.1  29  14
55135 KV878011.1     9883     1 102083687.1  13   6
55136 KV878011.1     9884     1 102083687.1  13   6
55138 KV878011.1     9886     1 102083687.1  10   3
55139 KV878011.1     9887     1 102083687.1  11   6
55140 KV878011.1     9888     1 102083687.1  12   6
> RPASE(phased_block_list2[[7]], phi=0.1)
Error: vector memory exhausted (limit reached?)
> phased_block_list2[[7]]
        scaffold position index        gene AD1 AD2
47211 CM007546.1    33750     1 102083720.1  33  10
47214 CM007546.1    34131     1 102083720.1  37  25
47215 CM007546.1    34132     1 102083720.1  36  19
47218 CM007546.1    34183     1 102083720.1   8   6
47219 CM007546.1    34184     1 102083720.1   8   8
47220 CM007546.1    34357     1 102083720.1  41  21
47221 CM007546.1    34358     1 102083720.1  42  21
47222 CM007546.1    34367     1 102083720.1  37  17
47223 CM007546.1    34368     1 102083720.1  36  17
47236 CM007546.1    34835     1 102083720.1   9   5
47237 CM007546.1    34836     1 102083720.1   9   5
47241 CM007546.1    34840     1 102083720.1   7   4
47255 CM007546.1    35391     1 102083720.1   5  17
47256 CM007546.1    35398     1 102083720.1  24  19
47258 CM007546.1    35431     1 102083720.1   6   6
47259 CM007546.1    35432     1 102083720.1   6   7
47272 CM007546.1    35904     1 102083720.1   6   4
47273 CM007546.1    35905    -1 102083720.1   3   7
47276 CM007546.1    36113     1 102083720.1  11   3
47277 CM007546.1    36114     1 102083720.1  11   4
> RPASE(phased_block_list2[[8]], phi=0.1)
[1] "102083765.1"       "0.215991131370712"
[1] 0.2159911
> phased_block_list2[[8]]
        scaffold position index        gene AD1 AD2
19021 CM007528.1    95255    -1 102083765.1   9   5
wangmi811 commented 5 years ago

Sorry for the late reply.

For "Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value ", it relates to that R's maximum vector length is 2^31-1. When phased_block_list has very large element, i.e., nrow(phased_block_list[[i]]) is very large, it is likely that this error appears.

In this situation, I would suggest (1) try to increase the filter for coverage, by using 'createPhasedBlockList(example_phased_vcf, example_annotation, min.coverage=20)' Depending on the data, one can explore a bit what to feed to min.coverage. (2) Split a very large element in the phased_block_list into several elements, to cut down computation resources.

In addition, I would also suggest running RPASE with so to say "error tolerance" in this situation. When one block from phased_block_list has a memory-limit issue, this block gets skipped and returns "NA", but RPASE continues to run to the next block. Then, in the end, we know how many blocks have memory issues and how many can be used by RPASE. RPASE is not designed to run on a laptop since it calculates exact p.value, which is computationally expensive.

Hope it helps :)