Skip to content

Commit

Permalink
Update test_002.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesjcai committed May 3, 2023
1 parent 0839c42 commit 0bb6c7e
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions test/test_002.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
struct SingleCellExperiment0
X::Matrix{Int16}
g::Vector{String}
SingleCellExperiment0(X,g) = size(X,1)!=length(g) ? error("size unmatch") : new(X,g)
end


struct SingleCellExperiment{T<:AbstractMatrix}
X::T
g::Vector{String}
s::Matrix
SingleCellExperiment(X,g,s) = size(X,1)!=length(g) ? error("size unmatch") : new{AbstractMatrix}(X,g,s)
end


struct SCE{T<:AbstractMatrix}
X::T
g::Vector{String}
Expand All @@ -23,7 +8,6 @@ struct SCE{T<:AbstractMatrix}
end
end


struct SCE5{T<:Any, M<:AbstractMatrix{T}}
X::M
g::Vector{String}
Expand All @@ -34,28 +18,41 @@ struct SCE5{T<:Any, M<:AbstractMatrix{T}}
# end
end

struct SingleCellExperiment0
X::Matrix{Int16}
g::Vector{String}
SingleCellExperiment0(X,g) = size(X,1)!=length(g) ? error("size unmatch") : new(X,g)
end



struct SingleCellExperiment{T<:AbstractMatrix}
X::T
g::Vector{String}
s::Matrix
SingleCellExperiment(X,g,s) = size(X,1)!=length(g) ? error("size unmatch") : new{AbstractMatrix}(X,g,s)
end

function SingleCellExperiment(X::AbstractMatrix,g::Vector{String})
s=rand(size(X,2),3)
SingleCellExperiment(X, g, s)
end


# SingleCellExperiment(X,g) = size(X,1)!=length(g) ? error("size unmatch") : new{AbstractMatrix}(X,g)



using ScRNAseq
cd("C:\\Users\\jcai\\Desktop\\refwrap_test\\forjulia")
#cd("C:\\Users\\jcai\\Desktop\\refwrap_test\\forjulia")
cd("C:\\Users\\jcai\\Documents\\GitHub\\ScRNAseq.jl\\test")


using HDF5
f=HDF5.h5open("hugedata.mat","r")
X=read(f,"X")
close(f)
X=convert(Array{Int16,2}, X)
X=convert(Matrix{Int16},X)

#f=HDF5.h5open("hugedata.mat","r")
#X=read(f,"X")
#close(f)
#X=convert(Array{Int16,2}, X)
#X=convert(Matrix{Int16},X)

f=HDF5.h5open("smalldata_Int16.mat","r")
X=read(f,"X")
Expand All @@ -69,7 +66,7 @@ using MAT
f=MAT.matopen("smalldata_sparse.mat")
X=read(f,"X") # out of memory error for large full matrix
g=read(f,"g") # not support MATLAB string, but cellstr is okay
g=convert(Matrix{String},g)
#g=convert(Matrix{String},g)
close(f)

X=convert(Matrix{Int16},X)
Expand Down

0 comments on commit 0bb6c7e

Please sign in to comment.