示例#1
0
 public SNPFeatures(SNPFeatures orig) : this(modshogunPINVOKE.new_SNPFeatures__SWIG_2(SNPFeatures.getCPtr(orig)), true)
 {
     if (modshogunPINVOKE.SWIGPendingException.Pending)
     {
         throw modshogunPINVOKE.SWIGPendingException.Retrieve();
     }
 }
示例#2
0
    public static double[,] get_2x3_table(SNPFeatures pos, SNPFeatures neg)
    {
        IntPtr ptr = modshogunPINVOKE.SNPFeatures_get_2x3_table(SNPFeatures.getCPtr(pos), SNPFeatures.getCPtr(neg));

        if (modshogunPINVOKE.SWIGPendingException.Pending)
        {
            throw modshogunPINVOKE.SWIGPendingException.Retrieve();
        }
        int[] ranks = new int[2];
        Marshal.Copy(ptr, ranks, 0, 2);

        int rows = ranks[0];
        int cols = ranks[1];
        int len  = rows * cols;

        double[] ret = new double[len];

        Marshal.Copy(new IntPtr(ptr.ToInt64() + 2 * Marshal.SizeOf(typeof(int))), ret, 0, len);

        double[,] result = new double[rows, cols];
        for (int i = 0; i < rows; i++)
        {
            for (int j = 0; j < cols; j++)
            {
                result[i, j] = ret[i * cols + j];
            }
        }
        return(result);
    }
示例#3
0
 public void obtain_base_strings(SNPFeatures snp)
 {
     modshogunPINVOKE.SNPFeatures_obtain_base_strings__SWIG_0(swigCPtr, SNPFeatures.getCPtr(snp));
     if (modshogunPINVOKE.SWIGPendingException.Pending)
     {
         throw modshogunPINVOKE.SWIGPendingException.Retrieve();
     }
 }
示例#4
0
    public static void Main()
    {
        modshogun.init_shogun_with_defaults();
        string             filename = "../data/snps.dat";
        StringByteFeatures sf       = new StringByteFeatures(EAlphabet.SNP);

        sf.load_ascii_file(filename, false, EAlphabet.SNP, EAlphabet.SNP);
        SNPFeatures snps = new SNPFeatures(sf);
    }
示例#5
0
    public static void Main()
    {
        modshogun.init_shogun_with_defaults();
        string filename = "../data/snps.dat";
        StringByteFeatures sf = new StringByteFeatures(EAlphabet.SNP);
        sf.load_ascii_file(filename, false, EAlphabet.SNP, EAlphabet.SNP);
        SNPFeatures snps = new SNPFeatures(sf);

        modshogun.exit_shogun();
    }
示例#6
0
    internal static ArrayList run(string filename)
    {
        filename = fname;
        modshogun.init_shogun_with_defaults();
        StringByteFeatures sf = new StringByteFeatures(SNP);
        sf.load_ascii_file(fname, false, SNP, SNP);
        SNPFeatures snps = new SNPFeatures(sf);

        ArrayList result = new ArrayList();
        result.Add(snps);

        modshogun.exit_shogun();
        return result;
    }
示例#7
0
 public void obtain_base_strings(SNPFeatures snp) {
   modshogunPINVOKE.SNPFeatures_obtain_base_strings__SWIG_0(swigCPtr, SNPFeatures.getCPtr(snp));
   if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
 }
示例#8
0
 public SNPFeatures(SNPFeatures orig) : this(modshogunPINVOKE.new_SNPFeatures__SWIG_2(SNPFeatures.getCPtr(orig)), true) {
   if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
 }
示例#9
0
 internal static HandleRef getCPtr(SNPFeatures obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
示例#10
0
  public static double[,] get_2x3_table(SNPFeatures pos, SNPFeatures neg) {
	IntPtr ptr = modshogunPINVOKE.SNPFeatures_get_2x3_table(SNPFeatures.getCPtr(pos), SNPFeatures.getCPtr(neg));
    if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
	int[] ranks = new int[2];
	Marshal.Copy(ptr, ranks, 0, 2);

	int rows = ranks[0];
	int cols = ranks[1];
	int len = rows * cols;

	double[] ret = new double[len];

	Marshal.Copy(new IntPtr(ptr.ToInt64() + 2 * Marshal.SizeOf(typeof(int))), ret, 0, len);

	double[,] result = new double[rows, cols];
	for (int i = 0; i < rows; i++) {
		for (int j = 0; j < cols; j++) {
			result[i, j] = ret[i * cols + j];
		}
	}
	return result;
}
示例#11
0
 internal static HandleRef getCPtr(SNPFeatures obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }