plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | zhenglab/UnderwaterImageRestoration-master | rgb2hsi.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/滤波方法/hsi空间/rgb2hsi.m | 1,485 | utf_8 | 1c2c4a76e1447dc3d7f434eac6438bda |
function hsi = rgb2hsi(rgb)
%RGB2HSI Converts an RGB image to HSI.
% HSI = RGB2HSI(RGB) converts an RGB image to HSI. The input image
% is assumed to be of size M-by-N-by-3, where the third dimension
% accounts for three image planes: red, green, and blue, in that
% order. If all RGB component images are ... |
github | zhenglab/UnderwaterImageRestoration-master | visibresto1.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/去雾类图像增强算法/可见度复原代码2/visibresto1.m | 7,450 | utf_8 | 8d1e87069b190f2d622b516c0e06163d | %
% 17/11/2009
% Author: J.-P. Tarel
% LCPC-INRETS-IFSTTAR copyright
% completed in 06/03/2013, corrected in 08/03/2013
%
% This algorithm is described in details in
%
%"Improved Visibility of Road Scene Images under Heterogeneous Fog",
% by J.-P. Tarel, N. Hautiere, A. Cord, D. Gruyer and H. Halmaoui,
% in proceeding... |
github | zhenglab/UnderwaterImageRestoration-master | visibresto.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/去雾类图像增强算法/可见度复原代码2/visibresto.m | 6,665 | utf_8 | 4dd923a3250be0652468b9a58a1825f1 | %
% 17/11/2009
% Author: J.-P. Tarel
% LCPC-INRETS-IFSTTAR copyright
% completed and corrected in 18/08/2010 and in 29/09/2010
%
% This algorithm is described in details in
%
% "Fast Visibility Restoration from a Single Color or Gray Level Image",
% by J.-P. Tarel and N. Hautiere,
% in proceedings of IEEE Internationa... |
github | zhenglab/UnderwaterImageRestoration-master | minfilt.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/去雾类图像增强算法/导向滤波暗通道去雾/minfilt.m | 1,783 | utf_8 | 64f0759727355541ba34fc762b9407b9 | function Y = minfilt(X,varargin)
% MINFILT2 Two-dimensional min filter
%
% Y = MINFILT2(X,[M N]) performs two-dimensional minimum
% filtering on the image X using an M-by-N window. The result
% Y contains the minimun value in the M-by-N neighborhood around
% each pixel in the original image.
% ... |
github | zhenglab/UnderwaterImageRestoration-master | maxfilt.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/去雾类图像增强算法/导向滤波暗通道去雾/maxfilt.m | 1,783 | utf_8 | c9afac379c3fedc1d1c60203d0e1df0d | function Y = maxfilt(X,varargin)
% MAXFILT2 Two-dimensional max filter
%
% Y = MAXFILT2(X,[M N]) performs two-dimensional maximum
% filtering on the image X using an M-by-N window. The result
% Y contains the maximun value in the M-by-N neighborhood around
% each pixel in the original image.
% ... |
github | zhenglab/UnderwaterImageRestoration-master | vanherk.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/去雾类图像增强算法/导向滤波暗通道去雾/vanherk.m | 4,665 | utf_8 | 29b98c380fda32f85f9b5f3d68ad8529 | function Y = vanherk(X,N,TYPE,varargin)
% VANHERK Fast max/min 1D filter
%
% Y = VANHERK(X,N,TYPE) performs the 1D max/min filtering of the row
% vector X using a N-length filter.
% The filtering type is defined by TYPE = 'max' or 'min'. This function
% uses the van Herk algorithm for min/max filters th... |
github | zhenglab/UnderwaterImageRestoration-master | visibresto.m | .m | UnderwaterImageRestoration-master/underwater image enhancement/codes/去雾类图像增强算法/可见度复原代码1/visibresto.m | 6,657 | utf_8 | 9f7a79e6d68460d72567ced5565076ec | %
% 17/11/2009
% Author: J.-P. Tarel
% LCPC-INRETS copyright
% completed and corrected in 18/08/2010 and in 29/09/2010
%
% This algorithm is described in details in
%
% "Fast Visibility Restoration from a Single Color or Gray Level Image",
% by J.-P. Tarel and N. Hautiere,
% in proceedings of IEEE International Confer... |
github | randombrein/MeanShift-master | mean_shift.m | .m | MeanShift-master/proj_static/mean_shift.m | 2,183 | utf_8 | ae49e5b6c879f7b97394e85433991ec4 | %
% mean_shift: mean-shift localised object tracking function
%
% Input
% image: image input
% center_x: initial center x-pos of the target patch
% center_y: initial center y-pos of the target patch
% q_u: target patch distribution
% roi: ROI position mask
% h: kern... |
github | randombrein/MeanShift-master | mask_boundary.m | .m | MeanShift-master/proj_static/mask_boundary.m | 1,090 | utf_8 | 043d1951783300f95a63bd1e5488017c | %
% mask_boundary: calculates boundary for a mask
%
% Input
% mask_idx: mask indicies (x,y)
% Ouput
% boun: boundary indicies for the mask input (x,y)
%
%
% File: mask_boundary.m
% Author: Evren KANALICI
% Date: 24/05/2016
% Computer Eng. - Computer Vision, Spring '16
% Yildiz Technical Uni... |
github | randombrein/MeanShift-master | color_distri.m | .m | MeanShift-master/proj_static/color_distri.m | 1,647 | utf_8 | 24c50dde53c35d76ef578e99a7c8dc57 | %
% color_distri: calculates quantized color distribution of the patch (PDD)
%
% Input
% image: image input
% cx: center x-pos of the patch
% cy: center y-pos of the patch
% xs: x-pos of patch mask
% ys: y-pos of patch mask
% h: kernel radius
% Ouput
% distri: quantized co... |
github | randombrein/MeanShift-master | im_overlay.m | .m | MeanShift-master/proj_static/im_overlay.m | 1,820 | utf_8 | 016cd339b6365a001dda922a6c84f086 | %
% im_overlay: overlay frame image with tracking (ROI + target)
%
% Input
% img: image input
% xs: x-pos of tracking
% ys: y-pos of tracking
% target_pos: target frame indicies
% roi_pos: ROI frame indicies
% Ouput
% img: overlaid image
%
%
% File: im_overlay.m... |
github | randombrein/MeanShift-master | patch_mask.m | .m | MeanShift-master/proj_static/patch_mask.m | 988 | utf_8 | 27d3992c2350be4c60c5df755421c5a7 | %
% patch_mask: calculates circular patch & ROI masks
%
% Input
% cx: center x-pos of patch
% cy: center y-pos of patch
% h: kernel radius
% roi_mult: ROI multiplier w.r.t kernel radius
% imageSizeX: image height
% imageSizeY: image width
% Ouput
% rx: circular patch mas... |
github | randombrein/MeanShift-master | color_weight.m | .m | MeanShift-master/proj_static/color_weight.m | 1,175 | utf_8 | 98bed7026bd7442379d48d0b4b4d4a22 | %
% color_weight: calculates weight for target/candidate patch distributions
%
% Input
% image: image input
% xs: x-pos of candidate mask
% ys: y-pos of candidate mask
% q_u: target patch distribution
% p_u: candidate patch distribution
% Ouput
% weight: weights for candidate
%
%
% File:... |
github | liuyuisanai/CaffeMex_v2-master | classification_demo.m | .m | CaffeMex_v2-master/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | gridlab-d/gridlab-d-master | parseAttributes.m | .m | gridlab-d-master/models/8500 Node System/Post Processing/parseAttributes.m | 575 | utf_8 | 7217d7bfb1199e1b0799e315d828bbae | % ----- Local function PARSEATTRIBUTES -----
function attributes = parseAttributes(theNode)
% Create attributes structure.
attributes = [];
if theNode.hasAttributes
theAttributes = theNode.getAttributes;
numAttributes = theAttributes.getLength;
allocCell = cell(1, numAttributes);
attributes = struct('Name'... |
github | gridlab-d/gridlab-d-master | makeStructFromNode.m | .m | gridlab-d-master/models/8500 Node System/Post Processing/makeStructFromNode.m | 489 | utf_8 | 05200be844e7189cee1a748d2316c43b | % ----- Local function MAKESTRUCTFROMNODE -----
function nodeStruct = makeStructFromNode(theNode)
% Create structure of node info.
nodeStruct = struct( ...
'Name', char(theNode.getNodeName), ...
'Attributes', parseAttributes(theNode), ...
'Data', '', ... |
github | gridlab-d/gridlab-d-master | savecase.m | .m | gridlab-d-master/matpower/matpower40_src/savecase.m | 16,399 | utf_8 | 2fca6b1da5aeef4e7bff986e5392e3b4 | function fname_out = savecase(fname, varargin)
%SAVECASE Saves a MATPOWER case file, given a filename and the data.
% SAVECASE(FNAME, CASESTRUCT)
% SAVECASE(FNAME, CASESTRUCT, VERSION)
% SAVECASE(FNAME, BASEMVA, BUS, GEN, BRANCH)
% SAVECASE(FNAME, BASEMVA, BUS, GEN, BRANCH, GENCOST)
% SAVECASE(FNAME, BASEMVA... |
github | gridlab-d/gridlab-d-master | qps_mips.m | .m | gridlab-d-master/matpower/matpower40_src/qps_mips.m | 7,736 | utf_8 | 7de72ce62d90add17ac31b5d337df5a8 | function [x, f, eflag, output, lambda] = qps_mips(H, c, A, l, u, xmin, xmax, x0, opt)
%QPS_MIPS Quadratic Program Solver based on MIPS.
% [X, F, EXITFLAG, OUTPUT, LAMBDA] = ...
% QPS_MIPS(H, C, A, L, U, XMIN, XMAX, X0, OPT)
% Uses the MATLAB Interior Point Solver (MIPS) to solve the following
% QP (quadrat... |
github | gridlab-d/gridlab-d-master | modcost.m | .m | gridlab-d-master/matpower/matpower40_src/modcost.m | 4,331 | utf_8 | 0cc3f7cd9b98dad7570e4e5f6787f3f7 | function gencost = modcost(gencost, alpha, modtype)
%MODCOST Modifies generator costs by shifting or scaling (F or X).
% NEWGENCOST = MODCOST(GENCOST, ALPHA)
% NEWGENCOST = MODCOST(GENCOST, ALPHA, MODTYPE)
%
% For each generator cost F(X) (for real or reactive power) in
% GENCOST, this function modifies the co... |
github | gridlab-d/gridlab-d-master | ipoptopf_solver.m | .m | gridlab-d-master/matpower/matpower40_src/ipoptopf_solver.m | 12,302 | utf_8 | a5378b6f31541a40f193863660c64d08 | function [results, success, raw] = ipoptopf_solver(om, mpopt)
%IPOPTOPF_SOLVER Solves AC optimal power flow using MIPS.
%
% [RESULTS, SUCCESS, RAW] = IPOPTOPF_SOLVER(OM, MPOPT)
%
% Inputs are an OPF model object and a MATPOWER options vector.
%
% Outputs are a RESULTS struct, SUCCESS flag and RAW output struct.
... |
github | gridlab-d/gridlab-d-master | qps_mips6.m | .m | gridlab-d-master/matpower/matpower40_src/qps_mips6.m | 7,971 | utf_8 | 691254bdf566b5486b4e161dacbf23d3 | function [x, f, eflag, output, lambda] = qps_mips6(H, c, A, l, u, xmin, xmax, x0, opt)
%------------------------------ deprecated ------------------------------
% MATLAB 6.x support to be removed in a future version.
%--------------------------------------------------------------------------
%QPS_MIPS Quadratic Pr... |
github | gridlab-d/gridlab-d-master | toggle_iflims.m | .m | gridlab-d-master/matpower/matpower40_src/toggle_iflims.m | 12,300 | utf_8 | fc5ccd171c355820554a3888112c4473 | function mpc = toggle_iflims(mpc, on_off)
%TOGGLE_IFLIMS Enable or disable set of interface flow constraints.
% MPC = TOGGLE_IFLIMS(MPC, 'on')
% MPC = TOGGLE_IFLIMS(MPC, 'off')
%
% Enables or disables a set of OPF userfcn callbacks to implement
% interface flow limits based on a DC flow model.
%
% These callb... |
github | gridlab-d/gridlab-d-master | loadcase.m | .m | gridlab-d-master/matpower/matpower40_src/loadcase.m | 10,643 | utf_8 | dd17404009cad78c0fde67936ebb5f0c | function [baseMVA, bus, gen, branch, areas, gencost, info] = loadcase(casefile)
%LOADCASE Load .m or .mat case files or data struct in MATPOWER format.
%
% [BASEMVA, BUS, GEN, BRANCH, AREAS, GENCOST] = LOADCASE(CASEFILE)
% [BASEMVA, BUS, GEN, BRANCH, GENCOST] = LOADCASE(CASEFILE)
% [BASEMVA, BUS, GEN, BRANCH] =... |
github | gridlab-d/gridlab-d-master | toggle_reserves.m | .m | gridlab-d-master/matpower/matpower40_src/toggle_reserves.m | 19,865 | utf_8 | 13746a3a56e3e682eb2b50552782ab42 | function mpc = toggle_reserves(mpc, on_off)
%TOGGLE_RESERVES Enable or disable fixed reserve requirements.
% MPC = TOGGLE_RESERVES(MPC, 'on')
% MPC = TOGGLE_RESERVES(MPC, 'off')
%
% Enables or disables a set of OPF userfcn callbacks to implement
% co-optimization of reserves with fixed zonal reserve requirement... |
github | gridlab-d/gridlab-d-master | t_mips.m | .m | gridlab-d-master/matpower/matpower40_src/t/t_mips.m | 11,634 | utf_8 | 60bcf8e8ffa947c06e42ae900bd9d92c | function t_mips(quiet)
%T_MIPS Tests of MIPS NLP solver.
% MIPS
% $Id: t_mips.m 4738 2014-07-03 00:55:39Z dchassin $
% by Ray Zimmerman, PSERC Cornell
% Copyright (c) 2010 by Power System Engineering Research Center (PSERC)
%
% This file is part of MIPS.
% See http://www.pserc.cornell.edu/matpower/ for mo... |
github | gridlab-d/gridlab-d-master | t_mips6.m | .m | gridlab-d-master/matpower/matpower40_src/t/t_mips6.m | 11,835 | utf_8 | 34d5487abc5ace5919ae32a1037bf997 | function t_mips6(quiet)
%------------------------------ deprecated ------------------------------
% MATLAB 6.x support to be removed in a future version.
%--------------------------------------------------------------------------
%T_MIPS6 Tests of MIPS NLP solver (for MATLAB 6).
% MIPS
% $Id: t_mips6.m 4738 2... |
github | gridlab-d/gridlab-d-master | pricelimits.m | .m | gridlab-d-master/matpower/matpower40_src/extras/smartmarket/pricelimits.m | 2,681 | utf_8 | f4146f03c6285350a5de6e0eafd33feb | function lim = pricelimits(lim, haveQ)
%PRICELIMITS Fills in a struct with default values for offer/bid limits.
% LIM = PRICELIMITS(LIM, HAVEQ)
% The final structure looks like:
% LIM.P.min_bid - bids below this are withheld
% .max_offer - offers above this are withheld
% ... |
github | gridlab-d/gridlab-d-master | auction.m | .m | gridlab-d-master/matpower/matpower40_src/extras/smartmarket/auction.m | 12,390 | utf_8 | cd9ea30ef0a97c15f25dc4de3822f2f8 | function [co, cb] = auction(offers, bids, auction_type, limit_prc, gtee_prc)
%AUCTION Clear auction based on OPF results (qty's and lambdas).
% [CO, CB] = AUCTION(OFFERS, BIDS, AUCTION_TYPE, LIMIT_PRC, GTEE_PRC)
% Clears a set of BIDS and OFFERS based on the results of an OPF, where the
% pricing is adjusted for... |
github | gridlab-d/gridlab-d-master | off2case.m | .m | gridlab-d-master/matpower/matpower40_src/extras/smartmarket/off2case.m | 16,319 | utf_8 | 923d5a1f95b06b0f4244e870a3b62ac2 | function [gen, gencost] = off2case(gen, gencost, offers, bids, lim)
%OFF2CASE Updates case variables gen & gencost from quantity & price offers.
% [GEN, GENCOST] = OFF2CASE(GEN, GENCOST, OFFERS, BIDS, LIM) updates
% GEN & GENCOST variables based on the OFFERS and BIDS supplied, where each
% is a struct (or BIDS ... |
github | gaobingaobingaobin/PIDSADMM-master | lassoILSADMM.m | .m | PIDSADMM-master/lassoILSADMM.m | 2,980 | utf_8 | 9c17997e4618bbab4bcb86b8dd760e25 | function [z, historz] = lassoILSADMM(A, b, lambda, rho,r,alpha)
tau=(alpha^2-alpha+4)/(alpha^2-2*alpha+5);
r=r*tau;
%r>rho||A^TA||
% lasso Solve lasso problem via ILSADMM
%
% [z, historz] = lasso(A, b, lambda, rho, alpha);
%
% Solves the following problem via ILSADMM:
%
% minimize 1/2*|| Az - b ||_2^2 + \l... |
github | gaobingaobingaobin/PIDSADMM-master | total_variationLSADMM.m | .m | PIDSADMM-master/total_variationLSADMM.m | 2,685 | utf_8 | 025598b686d58c4b4775de85319b328d | function [x, history] = total_variationLSADMM(b, lambda, rho,r,alpha)
% total_variation Solve total variation minimization via LSADMM
%
% [x, history] = total_variation(b, lambda, rho, alpha)
%
% Solves the following problem via LSADMM:
%
% minimize (1/2)||x - b||_2^2 + lambda * sum_i |x_{i+1} - x_i|
%
%OR... |
github | gaobingaobingaobin/PIDSADMM-master | lassoLSADMM.m | .m | PIDSADMM-master/lassoLSADMM.m | 2,885 | utf_8 | 16661eeb277503fe1a866bc0411d7cc4 | function [z, historz] = lassoLSADMM(A, b, lambda, rho,r,alpha)
% tau=(alpha^2-alpha+4)/(alpha^2-2*alpha+5);
% r=r*tau;
%r>rho||A^TA||
% lasso Solve lasso problem via LSADMM
%
% [z, historz] = lasso(A, b, lambda, rho, alpha);
%
% Solves the following problem via LSADMM:
%
% minimize 1/2*|| Az - b ||_2^2 + \... |
github | gaobingaobingaobin/PIDSADMM-master | total_variationILSADMM.m | .m | PIDSADMM-master/total_variationILSADMM.m | 2,778 | utf_8 | 1d9d7ed22018404b4cd2b8edd59d4279 | function [x, history] = total_variationILSADMM(b, lambda, rho,r,alpha)
tau=(alpha^2-alpha+4)/(alpha^2-2*alpha+5);
r=r*tau;
% total_variation Solve total variation minimization via ILSADMM
%
% [x, history] = total_variation(b, lambda, rho, alpha)
%
% Solves the following problem via ADMM:
%
% minimize (1/2)... |
github | cypw/EE5731R-GBVS-master | principalEigenvectorRaw.m | .m | EE5731R-GBVS-master/src/util/principalEigenvectorRaw.m | 567 | utf_8 | 44655d493a197723bdd3189693301b63 | %
% computes the principal eigenvector of a [nm nm] markov matrix
%
% j harel 6/06
function [v,iter] = principalEigenvectorRaw( markovA , tol )
if ( sparseness(markovA) < .4 )
markovA = sparse(markovA);
end
D = size(markovA,1);
df = 1;
v = ones(size(markovA,1),1)/D;
oldv = v;
oldoldv = v;
iter = 0;
while ( d... |
github | cypw/EE5731R-GBVS-master | gbvs_norm.m | .m | EE5731R-GBVS-master/src/layers/norm_layer/gbvs_norm.m | 1,053 | utf_8 | 0069ff6d8ca8d9981873229da4080927 | function top = gbvs_norm(bottom, param)
% {image,level}[x,y,channel]
% load
data = bottom.data;
% init
img_num = size(data,1);
img_level_num = size(data,2);
act_data = cell(size(bottom));
% processing
for i_img = 1:img_num
for i_level = 1:img_level_num
i_data = data{i_img, i_level};
i_act... |
github | cypw/EE5731R-GBVS-master | images.m | .m | EE5731R-GBVS-master/src/layers/data_layer/images.m | 1,046 | utf_8 | cecb15de8b7ce259f9dce3051bb281a0 | function top = images(bottom, param)
% {image,level}[x,y,channel]
% laod
img_info = bottom.data;
% init
if isfield(img_info, 'impath')
img_num = length(img_info.impath);
end
if isfield(img_info, 'img')
img_num = length(img_info.img);
end
img_level = param.level;
img_level_num = length(img_level);
img_data... |
github | cypw/EE5731R-GBVS-master | orientation.m | .m | EE5731R-GBVS-master/src/layers/fea_layer/orientation.m | 2,338 | utf_8 | 289ab0e5b33eed2bbcfd6709aae95e7b | function top = orientation(bottom, param)
% {image,level}[x,y,channel]
% laod
img_data = bottom.data;
% init
img_num = size(img_data,1);
img_level_num = size(img_data,2);
map_data = cell(img_num, img_level_num);
lambda = param.lambda;
angle = param.angle ./ 180 * pi;
psi = param.psi;
gamma = param.gamma;... |
github | cypw/EE5731R-GBVS-master | colors.m | .m | EE5731R-GBVS-master/src/layers/fea_layer/colors.m | 12,204 | utf_8 | 0778cf125a15fd9710a950b82569e9d4 | function top = colors(bottom, param)
% {image,level}[x,y,channel]
% load
img_data = bottom.data;
% init
img_num = size(img_data,1);
img_level_num = size(img_data,2);
map_data = cell(img_num, img_level_num);
% processing
for i_img = 1:img_num
im_size = size(img_data{i_img,1});
map_size = fix(im_size(1:2)./... |
github | cypw/EE5731R-GBVS-master | gbvs_act.m | .m | EE5731R-GBVS-master/src/layers/act_layer/gbvs_act.m | 1,065 | utf_8 | d92af3eea18c69db011b9ab9f47ccb1f | function top = gbvs_act(bottom, param)
% {image,level}[x,y,channel]
% load
data = bottom.data;
% init
img_num = size(data,1);
img_level_num = size(data,2);
act_data = cell(size(bottom));
% processing
for i_img = 1:img_num
for i_level = 1:img_level_num
i_data = data{i_img, i_level};
i_act ... |
github | MLSurvival/MTLSA-master | MTLSA.m | .m | MTLSA-master/MTLSA.m | 5,003 | utf_8 | b6ee6a088b02776f6ee0ca4bc291a097 | %% file MTLSA.m
% this file shows the process of ADMM methods of the MTLSA model
% "Multi-Task Learning model for Survival Analysis"
%to learn a parth wise solution of MTLSA
%
%% OBJECTIVE
% argmin_XB \in P 0.5 * norm (Wo(Y - X * B))^2
% + \lambad_1 * \|B\|_{2,1} + \lambad_2 * \|B\|_F^2}
%
%% RELATED PAPERS... |
github | MLSurvival/MTLSA-master | MTLSA_V2.m | .m | MTLSA-master/MTLSA_V2.m | 4,116 | utf_8 | d4d3b6c2edc07f12e24dba1d8342302c | %% file MTLSA_V2.m
% this file shows the usage of Least_L21_Weighted.m function
% to learn a parth wise solution of MTLSA.V2
%
%% OBJECTIVE
% argmin_{B} 1/2 norm(Wo(Y-XB))^2+\frac{\lambda_1}{2} \| B \|_F^2
% + \lambda_2 \| B \|_{2,1}
%
%% RELATED PAPERS
% [1]Yan Li, Jie Wang, Jieping Ye and Chandan K. ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_DrawMap.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_DrawMap.m | 1,906 | utf_8 | 441afe862e821530866d98133dd8bb68 |
function [DivRedPred, stats] = LS_DrawMap( outmap_pref, params, GEs, positions, cfg_inf )
if isstr(cfg_inf)
cfg_inf = file2struct(cfg_inf);
end
if isstr(GEs)
files_buildGE_file = GEs;
GEs = LS_PrecalcGridElements( files_buildGE_file, cfg_inf.GEs );
end
if isempty(positions) | (isstr(positions) & strcmp(... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | SwCoef.m | .m | DrosophilaLinkedSelectionMaps-master/code/SwCoef.m | 2,039 | utf_8 | 155c2ca191e1b4e11a2cae6e201bb3e2 |
function vSw = SwCoef( vS, Ne0, gFocSites, gSwSites, cfg ) %md_correction_used
% arguments in LS_PrecalcGridElements:
% SWbase{c,b} = SwCoef( CalcSW.FE_grid, CalcSW.Ne0, gFocGrid{c}, {Annots.SW{c}{b}.focals.gpos(Annots.SW{c}{b}.focals.isfake==0)}, CalcSW );
% vS - vector of deleterious fitness effect sizes
% Ne0 - e... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | genomewideStatisticsLight.m | .m | DrosophilaLinkedSelectionMaps-master/code/genomewideStatisticsLight.m | 1,767 | utf_8 | e247b743b800d899b0cffc58b8a3f268 |
function gwStats = genomewideStatisticsLight( fdata )
if nargin < 2
poolNcorrStats = 0;
end
C = length(fdata);
n_poly_sites = 0;
N_sites = 0;
sum_pq_product = 0;
comparisons = 0;
gMutDiv = [];
gwStats.mapL = 0;
for c=1:C
% this is the only part of the script that is used now. the labels are
% kind o... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | loadSWmap.m | .m | DrosophilaLinkedSelectionMaps-master/code/loadSWmap.m | 2,154 | utf_8 | d4bbb0f47d7bd66ce94a1ae79b008e41 |
function [SW, SWfake, pGrid, cfg] = loadSWmap( file, cfg )
% extract parameters from the commented lines
f = fopen(file,'rt');
if f==-1
error('SW-map file not found');
end
line = fgetl(f);
[cfg.chr_id, cfg.chr_len] = sscanf(line, '%s %d');
while (~isempty(line) & (line~=-1) & (line(1)=='#'))
[x, y] = st... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_LoadVariationData.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_LoadVariationData.m | 3,776 | utf_8 | 2518e4e71a21a043e63c8127026d662c |
function fdata = LS_LoadVariationData( inputfiles, vcfg ) %inputfiles_file
% inputs:
% inputfiles - configuration files containing input file names (one per chromosome)
% outputs:
% fdata - a struct containing all loaded variation data: genetic maps,
% polymorphism and local mutation rate estimates
... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | constraint_u_sum_ineq.m | .m | DrosophilaLinkedSelectionMaps-master/code/constraint_u_sum_ineq.m | 511 | utf_8 | 9a7395f3d6e48c3ffefb66a953b0d8a4 |
function [c,ceq] = constraint_u_sum_ineq(full_params, variables, ivariables)
global MLParamsStruct;
if nargin < 3
variables = [];
ivariables = [];
end
full_params(ivariables) = variables;
for k=1:MLParamsStruct.bsparam_annotations
if full_params(MLParamsStruct.bsparam_imaxu) > -10;
c(k) = log10(sum... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | composeLSMapFromElements.m | .m | DrosophilaLinkedSelectionMaps-master/code/composeLSMapFromElements.m | 5,627 | utf_8 | 82d89673f30862346064ebbeec820363 |
function DivRedPred = composeLSMapFromElements( only_calc_Red, gSWj, gBSj, params, SWbase_params, BSbase_params, EgMutDiv, config )
global MLParamsStruct;
if isempty(gSWj) & isempty(gBSj)
DivRedPred = [];
return;
end
if ~isempty(gSWj)
L = size(gSWj{1},2);
else
L = size(gBSj{1},2);
end
% integrate params f... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_LoadSelectionAnnotations.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_LoadSelectionAnnotations.m | 2,982 | utf_8 | 8dc13a9a7d4ec5b0a3817e8158e85bfb |
function Annots = LS_LoadSelectionAnnotations(...
chr_features_file,...
chr_id,...
genmap_files, genmap_token,...
SW_anno_files, SW_anno_tokens,...
BS_anno_files, BS_anno_tokens )
%% general inits
[ff_chr_id, ff_chr_len] = textread(chr_features_file, '%s\t%d', 'commentstyle', 'shell' ); %, 'headerline... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_DefaultConfiguration.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_DefaultConfiguration.m | 8,678 | utf_8 | b4c9ea5899d7b01d6763a0417b9780db |
function ncfg = LS_DefaultConfiguration( outfile, cfg )
% This function creates a new full inference configuration struct or
% updates/completes a given one.
% inputs:
% outfile - output configuration file name
% cfg - existing configuration struct
% outputs:
% ncfg - new/updated configuration stru... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_LoadGridElements.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_LoadGridElements.m | 534 | utf_8 | 6f0cc381641cc99fa73f0adc3f3e3a06 |
function GEs = LS_LoadGridElements( GEs_files, cfg_inf )
skip_generate_BS_maps = 1;
for c=1:length(cfg_inf.chromosomes)
for b=1:length(anno_tokens)
cfgBS_tmplt{c}.cons_table = Annots{b}{c}.file;
cfgBS_tmplt{c}.name = [cfg_inf.genmap_name anno_tokens{b}];
[~, GEs.B... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | constraint_u_sum.m | .m | DrosophilaLinkedSelectionMaps-master/code/constraint_u_sum.m | 511 | utf_8 | bf6a1e9de501cda5d2a07365a40c4ed3 |
function [c,ceq] = constraint_u_sum( full_params, varialbes, ivariables )
global MLParamsStruct;
if nargin < 3
variables = [];
ivariables = [];
end
full_params(ivariables) = variables;
for k=1:MLParamsStruct.bsparam_annotations
if full_params(MLParamsStruct.bsparam_imaxu) > -10;
ceq(k) = log10(sum... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | gl_initMLParamsStruct.m | .m | DrosophilaLinkedSelectionMaps-master/code/gl_initMLParamsStruct.m | 1,835 | utf_8 | 90e5c140a1e39c99b93418bb139b517d |
function gl_initMLParamsStruct()
global MLParamsStruct;
MLParamsStruct.tau_pos = 3;
MLParamsStruct.swparam_offset = 10; % DM what is the offset mean?
MLParamsStruct.swparam_masses = 11; % max number of s values used in the inference
MLParamsStruct.swparam_annotations = 4; % max number of annotations used, currently ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | SwCoef1point.m | .m | DrosophilaLinkedSelectionMaps-master/code/SwCoef1point.m | 621 | utf_8 | 25a0995bfd1591c0033e93e498d7b272 |
function SwCoef = SwCoef1point( S, Ne0, gFocSite, gSwSites, config )
if config.StopSum == 2
% complete...
SwCoef = 0;
else
if config.StopSum == 1
idx = find(abs(gSwSites-gFocSite)<config.gMaxDist); % this is the setting that is used
else
idx = [1:lengt... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LoadSWBase.m | .m | DrosophilaLinkedSelectionMaps-master/code/LoadSWBase.m | 713 | utf_8 | 58c457d535ba1ea820237b5453da9a29 |
function [SWbase, gFocGrid] = LoadSWBase( input_pref, cfg )
coefs = cfg.FE_grid;
for t=1:length(coefs)
te.inputfiles{t} = sprintf( '%s_s%.8f.sw', input_pref, coefs(t) );
[SWbase.gSWj{t}, SWbase.gSWj_fake{t}, gFocGrid.pos{t}, cfg] = loadSWmap( te.inputfiles{t}, cfg );
% we assume that all configuraion param... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | slidingWindowAveraging.m | .m | DrosophilaLinkedSelectionMaps-master/code/slidingWindowAveraging.m | 1,192 | utf_8 | 3c08b8027925b629413592cf11457c24 |
function sy = slidingWindowAveraging( x, y, window_size, window_jump, minimal_samples_per_window )
if ~exist('minimal_samples_per_window')
minimal_samples_per_window = 1;
end
y = double(y);
if isempty(x)
x = [0:length(y)-1];
else
[x,idx] = sort(double(x));
x = x-x(1);
y = y(idx);
end
% wins = (x(end)-x(1... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | SaveSWBase.m | .m | DrosophilaLinkedSelectionMaps-master/code/SaveSWBase.m | 2,228 | utf_8 | c60e5d8f5b2272b0486817fd42d19fb0 |
function te = SaveSWBase( output_pref, gFocGrid, SWbase )
% write SW levels for a single chromosome for a single annotation
for t=1:length(gFocGrid.pos)
te.outputfiles{t} = sprintf( '%s_t%.6f.sw', output_pref, SWbase.CalcSW.S(t) ); %SWbase.params{t}.S
f = fopen( te.outputfiles{t}, 'wt' );
% write header ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | Rsquare.m | .m | DrosophilaLinkedSelectionMaps-master/code/Rsquare.m | 505 | utf_8 | bafd3ef90cb2042b99fad8b93e8c58d8 |
function [R2, Dev2_obs_pred, Dev2_obs_Eobs] = Rsquare( obs, pred, weights, equalizemeans )
if nargin < 3 | isempty(weights)
weights = ones(size(obs));
end
if nargin < 4
equalizemeans = 0;
end
if equalizemeans
pred = pred/sum(weights.*pred)*sum(weights.*obs);
end
Eobs = sum(weights.*obs)/sum(weights); %mean(... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | strDateToday.m | .m | DrosophilaLinkedSelectionMaps-master/code/strDateToday.m | 155 | utf_8 | 97bcb1c38b1880259f573e03b5b88473 |
function stDate = strDateToday()
cc = clock;
stDate = [num2str(cc(1),'%02d') num2str(cc(2),'%02d') num2str(cc(3),'%02d')];
stDate = stDate(3:end);
end
|
github | sellalab/DrosophilaLinkedSelectionMaps-master | generateBbase.m | .m | DrosophilaLinkedSelectionMaps-master/code/generateBbase.m | 3,065 | utf_8 | 02a9e6d96080fcffac49cf64a1ac60e6 |
function [config, Bbase] = generateBbase(config, t, skip_generate)
if nargin < 3
skip_generate = 0;
'skipping generation of new Bmaps'
end
%from precalc function: generateBbase(CalcBS, CalcBS.FE_grid, CalcBS.skip_generate_maps);
% % params & configuration
%
% config.L = 1000000; %chr len in bp
% config.Et = 1... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | collectParams.m | .m | DrosophilaLinkedSelectionMaps-master/code/collectParams.m | 2,018 | utf_8 | 8103b7474a1cd810e5b23ba9834eb600 |
function param_stats = collectParams( calc, GEs, config )
param_stats.fit.samples = calc.samples;
param_stats.fit.het = calc.LHFuncStats.EHet;
param_stats.fit.EMutProx = calc.LHFuncStats.EMutProx;
param_stats.fit.logLH = calc.logLH;
param_stats.fit.AIC = 2*calc.DFs - 2*param_stats.fit.logLH*param_stats... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | integrateParams_Inference_N_GEs.m | .m | DrosophilaLinkedSelectionMaps-master/code/integrateParams_Inference_N_GEs.m | 4,142 | utf_8 | 03b4bfb1951541d6ee88906108e0056b |
function params = integrateParams_Inference_N_GEs( Inf_params, Inf_config, BSbase_params, SWbase_params, isX, iFE_grid_X )
global MLParamsStruct;
params.tau_div = Inf_params(MLParamsStruct.tau_pos);
%% BS param adjustments
[ params.BS.v_t,...
params.BS.w_t,...
params.BS.w_t_rel,...
params.BS.u_del_max... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | inferNFSW.m | .m | DrosophilaLinkedSelectionMaps-master/code/inferNFSW.m | 8,325 | utf_8 | 8f5f9972d2b14460043d48a3532edf5f |
function [calc, preLHstats] = inferNFSW( GEs, fdata, cfg_inf, bounds, masks, preLHstats, invar_files)
% cfg_inf.fmincon_retries = 0;
calc.init_params = bounds.init; % use the values just loaded in the previous script as the parameters here
calc.rangeL = bounds.rangeL; % use the L and H bounds just loaded in the pr... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_InferModel_f.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_InferModel_f.m | 2,692 | utf_8 | cfe62705fcd4a46980c1b1e8efe257f1 |
function [calc, maps, outcalc] = LS_InferModel_f( outfile_pref, files_invar_file, files_buildGE_file, files_codonmask_file, cfg_file )
%usage: LS_InferModel_f( 'LS_BS4SW3_', files_invar_file, files_buildGE_file, files_masks_file, infcfg_file );
% inputs:
% outfile_pref - prefix of inference results output... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_CreateBootstrapMasks.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_CreateBootstrapMasks.m | 2,530 | utf_8 | 97a90bf81c1cefecdcb5cd589b6d2efc |
function cfg = LS_CreateBootstrapMasks( files_bootstrap, cfg )
if isstr(files_bootstrap)
files_bootstrap = file2struct( files_bootstrap );
end
[ff_chr_id, ff_chr_len] = textread( files_bootstrap.chr_features_file, '%s %d', 'commentstyle', 'shell' ); %, 'headerlines', 1
for c=1:length(cfg.bootstrap.chromosomes)
i... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_StatsDataset.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_StatsDataset.m | 32,442 | utf_8 | c96bc2779c96e7b071aa80f5b687dcb8 |
function [anals, toymodelfits, preCalc] = LS_StatsDataset( config, fdata, focals, toymodelfits, calculate ) %, fcollated
% temp = [];
if nargin < 5 | isempty(calculate)
calculate = 1;
end
%% calculate simple genomewide average statistics from data, if not supplied (these statistics do not depend on the inferen... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_SetGenomicMask.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_SetGenomicMask.m | 1,114 | utf_8 | 106c2f8abeb07ee6a2b33315e48a02c6 |
function masks = LS_SetGenomicMask( codonmask_files, cfg_inf )
% This function loads masks marking which codons to use in the
% inference/evaluation.
Ci = length(cfg_inf.inf.chromosomes);
Ce = length(cfg_inf.chromosomes);
for c=1:Ci
cfg_inf.inf.inference_file{c} = '';
masks.inference{c} = [];
end
for c=1:Ce
... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | struct2file.m | .m | DrosophilaLinkedSelectionMaps-master/code/struct2file.m | 6,200 | utf_8 | 28e51f7b49c10d918f5c74c9775a52c9 |
function struct2file( s, filename )
% currently supported fields: numeric matrices, (single) strings, string matrices, numeric-matrix matrices.
% unsupported: struct arrays, mixed matrices/strings cell arrays.
% syntax: ';' after the field name separate it from its value, if it's a single entry rather than a 1X1 cell... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_SaveGridElements.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_SaveGridElements.m | 815 | utf_8 | 9ac5ce836b5133a7be3a7b11f70de59f |
function LS_SaveGridElements( ourput_pref, GEs, cfg_inf )
% chr_id = {'2L', '2R', '3L', '3R', 'X'};
for c=1:size(GEs.BSbase,1) % chromosomes
for b=1:size(GEs.BSbase,2) % annotations
for t=1:length(GEs.BSbase{c,b}.Lj) % annotations
% write header with relevant parameters
struct2file();
% ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | epsilonFromBoundary.m | .m | DrosophilaLinkedSelectionMaps-master/code/epsilonFromBoundary.m | 295 | utf_8 | c1490b36094b237a3ddf3156a81b88a5 |
function xx = epsilonFromBoundary( x, rangeL, rangeH, rel_epsilon )
xx = x;
ii = find( x==rangeL & rangeL<rangeH );
xx(ii) = rangeL(ii)*(1-rel_epsilon) + rangeH(ii)*rel_epsilon;
ii = find( x==rangeH & rangeL<rangeH );
xx(ii) = rangeH(ii)*(1-rel_epsilon) + rangeL(ii)*rel_epsilon;
end
|
github | sellalab/DrosophilaLinkedSelectionMaps-master | composePredictedDiversity2.m | .m | DrosophilaLinkedSelectionMaps-master/code/composePredictedDiversity2.m | 3,695 | utf_8 | e08e31819d000143debb1a93f2213b91 |
function [gSWj, gBSj, SWparams, BSparams, DivRedPred] = composePredictedDiversity2( SWbase, SWgpos, BSbase, params, config, pos, EgMutDiv ) %, remote2closeDiv
% function [DivRedPred, sumeps] = composePredictedDiversity2( preLH, params, config, gpos )
% calculating the predicted reduction in diversity due to linked se... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | trapProbability.m | .m | DrosophilaLinkedSelectionMaps-master/code/trapProbability.m | 2,641 | utf_8 | 07c9cce1fa613d7f1ebaa4ab7661e7f0 |
function [vEpsilon, vS, vS_weights] = trapProbability(vR, Ne, vS, vS_weights, sweep_approx)
% this function reproduces Durrett's book tables, with input N/2
eulero = -psi(1);
L = length(vR);
if 0 %length(vR>5000) % this is completely deactivated...
% delta = 1/100;
% % delta = 1/100;
% towardsTail = 2;
% ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | calcSPdf_byParamsConfigNF.m | .m | DrosophilaLinkedSelectionMaps-master/code/calcSPdf_byParamsConfigNF.m | 960 | utf_8 | cbc800338188b49e1c14d5af050484c8 |
function [v_s, coalrate_s] = calcSPdf_byParamsConfigNF(s_params, SWbase_params, config)
global MLParamsStruct;
v_s = [];
coalrate_s = [];
for a=1:length(SWbase_params)
v_s{a} = SWbase_params{a}.s; % v_s is just the set of s params
coalrate_s{a} = zeros(size(v_s{a})); % coalrate initialized as a vector of zeros... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | thinnedToGrid.m | .m | DrosophilaLinkedSelectionMaps-master/code/thinnedToGrid.m | 1,087 | utf_8 | f2df76cb665bec2445b7582f020a25de |
function [thinned_pos, thinned_idx, needed] = thinnedToGrid( pos, grid )
[pos, idx] = unique(pos);
delta = grid(1);
pos_min = grid(2);
pos_max = grid(3);
% needed = zeros(size(pos));
%
% for curpos = pos_min:delta:pos_max
% needed(find(pos>=curpos,1,'first')) = 1;
% needed(find(pos<=curpos,1,'last' )) = 1;
... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | calcTPdf_byParamsConfig.m | .m | DrosophilaLinkedSelectionMaps-master/code/calcTPdf_byParamsConfig.m | 2,173 | utf_8 | 6a6cdbd3df9f7ff5bcae6ec61dd99de5 |
function [v_t, w_t, w_t_rel, u_del_max, u_del, u_del_rel, nsites_del] = calcTPdf_byParamsConfig( t_params, BSbase_params, config )
global MLParamsStruct;
v_t = [];
w_t = [];
w_t_rel = [];
u_del = [];
minimal_log10_t = -10 + 0.001; % reset this to be just above the null -10 that is used on fixed params...
u_del_max... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | SaveLSMap.m | .m | DrosophilaLinkedSelectionMaps-master/code/SaveLSMap.m | 456 | utf_8 | 68af7b627ea058c421d582a835af4dd5 |
function errval = SaveLSMap( outpref, LSDivPreds, res )
errval = 0;
if nargin<3
res = 100;
end
% pos, LS, BS, SW
f = fopen( [outpref '.LS'], 'wt' );
fprintf(f, '#RES=%d\n', res);
fprintf(f, '#pos\tLS\tBS\t1/(1+CS)\n');
for i=1:length(LSDivPreds.pos)
fprintf(f, '%d\t%d\t%d\t%d\n', LSDivPreds.po... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | resampleDiscreteDistribution.m | .m | DrosophilaLinkedSelectionMaps-master/code/resampleDiscreteDistribution.m | 575 | utf_8 | 65db1cb539e22639730359fde48cb612 |
function [w1, x1] = resampleDiscreteDistribution( x0, w0, x1, support_edges )
[x0, idx] = sort(x0);
w0 = w0(idx);
x1 = sort(x1);
% w0 = w0 / sum(w0);
% this is a grid of interpolation points for the continuous approximation of the cdf
x0i = [support_edges(1) (x0(1:end-1)+x0(2:end))/2 support_edg... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | timeToFixation.m | .m | DrosophilaLinkedSelectionMaps-master/code/timeToFixation.m | 2,013 | utf_8 | 9979749b60c575ee6c1309ab6e57f359 |
function ttf = timeToFixation( Ne, s, method, p0, p1 )
% approximating the time to fixation of a favorable allele with heteryzygous selective
% advantage s in a population of N diploids from a single copy (p0=1/2N)
if ~exist('p0')
p0 = 1/(2*Ne);
end
if ~exist('p1')
p1 = 1 - 1/(2*Ne);
end
switch method
case 'd... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | spatAverageRecRat.m | .m | DrosophilaLinkedSelectionMaps-master/code/spatAverageRecRat.m | 484 | utf_8 | 8f09d4ab8c995b34fa7eb73ce66b0ca4 |
function grat = spatAverageRecRat( genmap, pos, rec_spat_window )
gpos0 = applyGenmap2pos( genmap, max(min(genmap.pos), pos) );
gpos1 = applyGenmap2pos( genmap, max(min(genmap.pos), pos-rec_spat_window/2) ); %
gpos2 = applyGenmap2pos( genmap, min(max(genmap.pos), pos+rec_spat_window/2) ); %pos+rec_spat_window/2
w... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | calcPreLHStatsSw.m | .m | DrosophilaLinkedSelectionMaps-master/code/calcPreLHStatsSw.m | 3,477 | utf_8 | 6dfd3cf190a7f527d0f0e93013e91a30 |
function preLHstats = calcPreLHStatsSw( SWbase, SWgpos, BSbase, data, config, weights, ccounts, pos_external, gpos_external ) %remote2closeDiv,
% min_paml_codons = 100;
% scale_dS = 1; %0.4;
if ~exist('gpos_external')
preLHstats.gpos_ext = [];
else
preLHstats.gpos_ext = gpos_external;
end
if ~exist('pos_exter... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | createCalcBkgdConfig.m | .m | DrosophilaLinkedSelectionMaps-master/code/createCalcBkgdConfig.m | 2,022 | utf_8 | 7fc81383f5121616690457411b2afad2 |
function errval = createCalcBkgdConfig( conf_file, config )
errval = 0;
% config.Et = 10^-4;
% config.u_del = 10^-7;
% config.t_dist_type = 'POINT';
% config.t_dist_gamma_shape = 0.3;
%
% config.chr_features = 'E:\Downloads\human\chromosome_features.txt';
% config.rec_table = 'E:\Downloads\human\genetic_maps\Myers\... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | loadBmap.m | .m | DrosophilaLinkedSelectionMaps-master/code/loadBmap.m | 2,114 | utf_8 | 7058b7959527593c68dca5ac0cc0baf2 |
function [BL, cfg] = loadBmap( file )
% extract parameters from the commented lines
% cfg.res = 1000;
% file
f = fopen(file,'rt');
if f==-1
error('BS-map file not found');
end
line = fgetl(f);
[cfg.chr_id, cfg.chr_len] = sscanf(line, '%s %d');
while (~isempty(line) & (line~=-1) & (line(1)=='#'))
[x, y] = ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | logCL_SW.m | .m | DrosophilaLinkedSelectionMaps-master/code/logCL_SW.m | 3,289 | utf_8 | bea2dfa86151434081c854bf37452ed8 |
function [neg_log_P, neg_log_samples, stats, vlogL] = logCL_SW(preCalc, full_params, config, variables, ivariables)
global MLParamsStruct;
% To prevent zero probability of observing a SNP (which would ruin the
% maximization) we put a lower bound on the relative predicted diversity to
% be 0.1% of the maximal value ... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | applyGenmap2pos.m | .m | DrosophilaLinkedSelectionMaps-master/code/applyGenmap2pos.m | 994 | utf_8 | d2df10c794503293768335fe0973d503 |
function [outpos, outrat] = applyGenmap2pos(genmap, inpos, invert)
if nargin < 3
invert = 0;
end
if ~invert
% 'condition 1' THIS IS THE CONDITION THAT RUNS IN THE DEFAULT CONFIG
% the point of this function is to interpolate the map distance between SW sites based on the genetic map we have
outpos = int... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | LS_InferModel.m | .m | DrosophilaLinkedSelectionMaps-master/code/LS_InferModel.m | 7,816 | utf_8 | 3965e8680acf84faa181b73988f7af28 |
function calc = LS_InferModel( outfile_pref, fdata, GEs, cfg_inf, masks, invar_files )
% This function wraps the inference procedure, given prepared input
% structs of variations data (fdata), including grid elements (GEs), an
% inference configuration struct, and if supplied, masks pointing which codons to use.
... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | file2struct.m | .m | DrosophilaLinkedSelectionMaps-master/code/file2struct.m | 4,381 | utf_8 | 39d0bd2fa8865169342d17203ff1e9ce |
function s = file2struct( filename )
% currently supported fields: numeric matrices, (single) strings, string matrices, numeric-matrix matrices.
% unsupported: struct arrays, mixed matrices/strings cell arrays.
% syntax: ';' after the field name separate it from its value, if it's a single entry rather than a 1X1 cel... |
github | sellalab/DrosophilaLinkedSelectionMaps-master | loadBbase.m | .m | DrosophilaLinkedSelectionMaps-master/code/loadBbase.m | 380 | utf_8 | 98537057b8c3d5ba85d5a6bea4c2af12 | %% loading a base of atom-based B maps
function Bbase = loadBbase(maps, mapsdir)
if nargin==1 || isempty(mapsdir)
mapsdir = '';
end
for k=1:length(maps)
[BL{k}, cfg{k}] = loadBmap([mapsdir maps{k}]);
end
for k=1:length(BL)
rpos = cumsum(BL{k}(:,2));
Bbase.Lj{k} = [rpos(1); diff(rpos)]';
Bbase.Bj{k} ... |
github | he-zhe/TwoFlyTracker-master | check_correction.m | .m | TwoFlyTracker-master/check_correction.m | 10,661 | utf_8 | 34793003167b5dc5699d4e6194032e00 |
%MANUAL_CORRECTION Summary of this function goes here
% Detailed explanation goes here
function [] = check_correction()
allfiles_ori = uigetfile('*.mp4','MultiSelect','on');
if ~ischar(allfiles_ori)
allfiles = cell2struct(allfiles_ori,'name');
else
allfiles = struct;
allfiles(1).name = allfiles_ori;... |
github | he-zhe/TwoFlyTracker-master | manual_correction.m | .m | TwoFlyTracker-master/manual_correction.m | 12,214 | utf_8 | 32c481d2723cf8b831d88693f2e977e5 |
%MANUAL_CORRECTION Correct possible mistakes by automated tracking
% A GUI designed to check tracking result and correct potential mistakes.
% Use 'switch' button when male & female are detected inversely.
function [] = manual_correction()
allfiles_ori = uigetfile('*.avi','MultiSelect','on');
if ~ischar(allfile... |
github | he-zhe/TwoFlyTracker-master | mark_frames.m | .m | TwoFlyTracker-master/mark_frames.m | 10,690 | utf_8 | 35a93e9afb5433b7e27c9c4b3be998d7 |
%MANUAL_CORRECTION Summary of this function goes here
% Detailed explanation goes here
function [] = mark_frames()
allfiles_ori = uigetfile('*.mp4','MultiSelect','on');
if ~ischar(allfiles_ori)
allfiles = cell2struct(allfiles_ori,'name');
else
allfiles = struct;
allfiles(1).name = allfiles_ori;
end
... |
github | he-zhe/TwoFlyTracker-master | annotate_video.m | .m | TwoFlyTracker-master/annotate_video.m | 12,850 | utf_8 | b4ef18852c41e42860456aebf8203ce6 | % AnnotateVideo.m
% created by Srinivas Gorur-Shandilya at 13:46 , 28 August 2013. Contact me
% at http://srinivas.gs/contact/
% AnnotateVideo.m is a master GUI that is meant to annotate fly movies with
% information that a tracking algo can use to automatically track fly
% trajectories.
% -----------------------------... |
github | he-zhe/TwoFlyTracker-master | oss.m | .m | TwoFlyTracker-master/utils/oss.m | 534 | utf_8 | f0dcf55135bbf9386d99c25854e2091b | % oss.m
% OS-based slash
%
% created by Srinivas Gorur-Shandilya at 10:20 , 09 April 2014. Contact me at http://srinivas.gs/contact/
%
% This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
% To view a copy of this license, visit http://creativecommons.org/... |
github | he-zhe/TwoFlyTracker-master | circfit.m | .m | TwoFlyTracker-master/utils/circfit.m | 660 | utf_8 | 7774554ca9bfead44a21d6951727ad37 | % circfit.m
% fits a circle to a set of points
function [xc,yc,R,a] = circfit(x,y)
%
% [xc yx R] = circfit(x,y)
%
% fits a circle in x,y plane in a more accurate
% (less prone to ill condition )
% procedure than circfit2 but using more memory
% x,y are column vector where (x(i),y(i)) is a measured point
%
% ... |
github | he-zhe/TwoFlyTracker-master | ROI2mask.m | .m | TwoFlyTracker-master/utils/ROI2mask.m | 529 | utf_8 | f96ef0e1c963c62d25d68d8a8cb9e1a6 | % created by Srinivas Gorur-Shandilya at 19:42 , 04 December 2013. Contact me at http://srinivas.gs/contact/
% builds a logical matrix the size of the frame based on circular ROIs
function [mask] = ROI2mask(ff,ROIs)
%disp('Building ROI mask...')
mask = squeeze(0*ff(:,:,1));
for i = 1:size(ff,2)
for j =1:size(ff,1)
... |
github | he-zhe/TwoFlyTracker-master | ComputeOnsOffs.m | .m | TwoFlyTracker-master/utils/ComputeOnsOffs.m | 1,022 | utf_8 | 781c48a9e6efb4ba4e2511ca1161389c | % ComputeOnsOffs.m
% given a logical vector x, this function returns the on and off times of the logical vector
% usage:
% [ons,offs] = ComputeOnsOffs(x)
% created by Srinivas Gorur-Shandilya at 10:20 , 09 April 2014. Contact me at http://srinivas.gs/contact/
%
% This work is licensed under the Creative Commons Attri... |
github | he-zhe/TwoFlyTracker-master | foldername.m | .m | TwoFlyTracker-master/utils/foldername.m | 456 | utf_8 | 216b434ada9f5cc3758a7e4d4cb65c40 | % foldername.m
% returns the current folder's name
%
% created by Srinivas Gorur-Shandilya at 12:44 , 27 November 2014. Contact me at http://srinivas.gs/contact/
%
% This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
% To view a copy of this license, visi... |
github | jnowotarski/electricitypriceforecasting-master | qra.m | .m | electricitypriceforecasting-master/QRA/qra.m | 4,789 | utf_8 | 11b81cedd7d28d9b182464b38ec3ea84 | function IntFor = qra(y,X,tau)
%QRA Perform Quantile Regression Averaging
% QRA(Y,X,TAU) returns an interval forecast at confidence level
% (1-tau)*100% obtained using QUANTILE REGRESSION AVERAGING (QRA) [1].
% In the quantile regression model Y is an independent variable in and
% variable of interest to hav... |
github | daijifeng001/R-FCN-master | rfcn_test.m | .m | R-FCN-master/functions/rfcn/rfcn_test.m | 7,636 | utf_8 | 00870ee3241dd7b1a4b24e6503d2e737 | function mAP = rfcn_test(conf, imdb, roidb, varargin)
% mAP = rfcn_test(conf, imdb, roidb, varargin)
% --------------------------------------------------------
% R-FCN implementation
% Modified from MATLAB Faster R-CNN (https://github.com/shaoqingren/faster_rcnn)
% Copyright (c) 2016, Jifeng Dai
% Licensed under The MI... |
github | daijifeng001/R-FCN-master | rfcn_get_minibatch.m | .m | R-FCN-master/functions/rfcn/rfcn_get_minibatch.m | 6,984 | utf_8 | 8319068e79f3221b96e5b47621feb8ca | function net_inputs = rfcn_get_minibatch(conf, image_roidb)
% net_inputs = rfcn_get_minibatch(conf, image_roidb)
% --------------------------------------------------------
% R-FCN implementation
% Modified from MATLAB Faster R-CNN (https://github.com/shaoqingren/faster_rcnn)
% Copyright (c) 2016, Jifeng Dai
% Licensed ... |
github | daijifeng001/R-FCN-master | rfcn_train.m | .m | R-FCN-master/functions/rfcn/rfcn_train.m | 10,097 | utf_8 | 0a3ee4633b808e49b9057ca12ea3eed1 | function save_model_path = rfcn_train(conf, imdb_train, roidb_train, varargin)
% save_model_path = rfcn_train(conf, imdb_train, roidb_train, varargin)
% --------------------------------------------------------
% R-FCN implementation
% Modified from MATLAB Faster R-CNN (https://github.com/shaoqingren/faster_rcnn)
% Copy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.