C function getXStringSetClass() was a wrapper around C function
get_XStringSet_xsbaseclassname() defined in the Biostrings package,
which is itself a wrapper around C function get_List_elementType()
defined in the S4Vectors package. However, get_XStringSet_xsbaseclassname()
is about to be removed from Biostrings so any call to it should be replaced
with a call to get_List_elementType(). But since getXStringSetClass() is
not used, I removed it instead of fixing it (the fix would have been to
make it a wrapper around get_List_elementType() instead of around
get_XStringSet_xsbaseclassname()).
... | ... |
@@ -54,11 +54,6 @@ ByteStringVector XStringSet2ByteStringVec(SEXP xssR) |
54 | 54 |
return(result); |
55 | 55 |
} |
56 | 56 |
|
57 |
-const char * getXStringSetClass(SEXP xR) |
|
58 |
-{ |
|
59 |
- return get_XStringSet_xsbaseclassname(xR); |
|
60 |
-} |
|
61 |
- |
|
62 | 57 |
char DNAorRNAdecode(int c, int decodeType) |
63 | 58 |
{ |
64 | 59 |
if (decodeType == DT_RNA_BIOSTRING) |
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/kebabs@97254 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/kebabs@97200 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/kebabs@97101 bc3139a8-67e5-0310-9ffc-ced21a209358
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/kebabs@95191 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,76 @@ |
1 |
+#include "ByteStringVector.h" |
|
2 |
+#include "IRanges_interface.h" |
|
3 |
+#include "Biostrings_interface.h" |
|
4 |
+ |
|
5 |
+ByteStringVector charVector2ByteStringVec(SEXP cvR) |
|
6 |
+{ |
|
7 |
+ ByteStringVector result; |
|
8 |
+ result.length = LENGTH(cvR); |
|
9 |
+ |
|
10 |
+ if (result.length > 0) |
|
11 |
+ { |
|
12 |
+ result.nchar = (int *)R_alloc(result.length, sizeof(int)); |
|
13 |
+ result.ptr = (char **)R_alloc(result.length, sizeof(char *)); |
|
14 |
+ |
|
15 |
+ for (R_len_t i = 0; i < result.length; i++) |
|
16 |
+ { |
|
17 |
+ result.ptr[i] = (char *)CHAR(STRING_ELT(cvR, i)); |
|
18 |
+ result.nchar[i] = strlen(result.ptr[i]); |
|
19 |
+ } |
|
20 |
+ } |
|
21 |
+ else |
|
22 |
+ { |
|
23 |
+ result.nchar = NULL; |
|
24 |
+ result.ptr = NULL; |
|
25 |
+ } |
|
26 |
+ |
|
27 |
+ return(result); |
|
28 |
+} |
|
29 |
+ |
|
30 |
+ByteStringVector XStringSet2ByteStringVec(SEXP xssR) |
|
31 |
+{ |
|
32 |
+ ByteStringVector result; |
|
33 |
+ XStringSet_holder holder = hold_XStringSet(xssR); |
|
34 |
+ result.length = get_XStringSet_length(xssR); |
|
35 |
+ |
|
36 |
+ if (result.length > 0) |
|
37 |
+ { |
|
38 |
+ result.nchar = (int *)R_alloc(result.length, sizeof(int)); |
|
39 |
+ result.ptr = (char **)R_alloc(result.length, sizeof(char *)); |
|
40 |
+ |
|
41 |
+ for (int i = 0; i < result.length; i++) |
|
42 |
+ { |
|
43 |
+ Chars_holder s = get_elt_from_XStringSet_holder(&holder, i); |
|
44 |
+ result.nchar[i] = s.length; |
|
45 |
+ result.ptr[i] = (char *)s.seq; |
|
46 |
+ } |
|
47 |
+ } |
|
48 |
+ else |
|
49 |
+ { |
|
50 |
+ result.nchar = NULL; |
|
51 |
+ result.ptr = NULL; |
|
52 |
+ } |
|
53 |
+ |
|
54 |
+ return(result); |
|
55 |
+} |
|
56 |
+ |
|
57 |
+const char * getXStringSetClass(SEXP xR) |
|
58 |
+{ |
|
59 |
+ return get_XStringSet_xsbaseclassname(xR); |
|
60 |
+} |
|
61 |
+ |
|
62 |
+char DNAorRNAdecode(int c, int decodeType) |
|
63 |
+{ |
|
64 |
+ if (decodeType == DT_RNA_BIOSTRING) |
|
65 |
+ return RNAdecode((char) c); |
|
66 |
+ else |
|
67 |
+ return DNAdecode((char) c); |
|
68 |
+} |
|
69 |
+ |
|
70 |
+char DNAorRNAencode(int c, int encodeType) |
|
71 |
+{ |
|
72 |
+ if (encodeType == DT_RNA_BIOSTRING) |
|
73 |
+ return RNAencode((char) c); |
|
74 |
+ else |
|
75 |
+ return DNAencode((char) c); |
|
76 |
+} |