Skip to content

Commit f3c31a7

Browse files
committed
bugs fixed
1 parent 907e53d commit f3c31a7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

R/GenericMethods.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
globalVariables(c("cdslen", "end", "start", 'tga', "tlen", "."))
1+
globalVariables(c("cdslen", "end", "start", 'tga', "tlen", ".","gid"))
22

33
# ==============================================================================
44
# setGeneric
@@ -236,7 +236,8 @@ setMethod("filterRepTrans",
236236
}
237237

238238
# return data.frame
239-
tranLength <- data.frame(gid = unique(tg$gene_id),
239+
tranLength <- data.frame(gname = unique(tg$gene_name),
240+
gid = unique(tg$gene_id),
240241
tid = tida[x],
241242
tlen = sum(tmp$width),
242243
cdslen = cdslen)
@@ -344,13 +345,16 @@ setMethod("getLongName",
344345
if("5UTR" %in% ginfo.s$type | "five_prime_utr" %in% ginfo.s$type){
345346
cds.sp <- cds.len + cds.st - 1
346347
}else{
347-
cds.sp <- cds.len + cds.st
348+
if("CDS" %in% ginfo.s$type){
349+
cds.sp <- cds.len + cds.st - 1
350+
}else{
351+
cds.sp <- cds.len + cds.st
352+
}
348353
}
349354

350-
351355
# name
352-
tname <- paste(gname,tid,cds.st,cds.sp,tlen,sep = sep)
353-
res <- data.frame(gid = gname,tid = tid,tname = tname)
356+
tname <- paste(gname,gid,tid,cds.st,cds.sp,tlen,sep = sep)
357+
res <- data.frame(gname = gname,gid = gid,tid = tid,tname = tname)
354358
return(res)
355359
}) -> resName
356360
# }) %>% do.call("rbind",.) %>% data.frame() -> resName

0 commit comments

Comments
 (0)