如何解决基因组范围 - 在单个文件中合并重叠 (R STUDIO)
我想在文件中找到重叠的区域并合并它们,保持较早的开始和较晚的停止(将 2 个区域合并为 1)
我打算使用基因组范围,但我不确定如何编写脚本。
这是文件 fileA.txt 包含的内容:
// Display the field
add_action( 'woocommerce_review_order_before_payment','switch_toggle_fee_on_checkout',20 );
function switch_toggle_fee_on_checkout() {
echo '<div class="switch-toggle-wrapper">
<span>' . __("To add the company discount,toggle this switch.","woocommerce") . ' </span>
<label class="switch">
<input type="checkbox" name="company_discount" id="company_discount">
<span class="slider round"></span>
</label>
</div>';
}
// jQuery Ajax sender function
add_action( 'wp_footer','checkout_toggle_discount_script' );
function checkout_toggle_discount_script() {
if( is_checkout() && ! is_wc_endpoint_url() ) :
if( WC()->session->__isset('enable_discount') ) {
WC()->session->__unset('enable_discount');
}
?>
<script type="text/javascript">
jQuery( function($){
if (typeof wc_checkout_params === 'undefined')
return false;
$('form.checkout').on('change','input[name="company_discount"]',function(){
console.log('toggle');
var toggle = $(this).prop('checked') === true ? '1' : '0';
$.ajax( {
type: 'POST',url: wc_checkout_params.ajax_url,data: {
'action': 'enable_discount','discount_toggle': toggle,},success: function (result) {
$('body').trigger('update_checkout');
},});
});
});
</script>
<?php
endif;
}
// Ajax receiver: Set a WC_Session variable
add_action( 'wp_ajax_enable_discount','checkout_enable_discount_ajax' );
add_action( 'wp_ajax_nopriv_enable_discount','checkout_enable_discount_ajax' );
function checkout_enable_discount_ajax() {
if ( isset($_POST['discount_toggle']) ) {
WC()->session->set('enable_discount',esc_attr($_POST['discount_toggle']) ? true : false );
echo esc_attr($_POST['discount_toggle']);
}
wp_die();
}
// Set the discount
add_action( 'woocommerce_cart_calculate_fees','checkout_set_discount',20,1 );
function checkout_set_discount( $cart ) {
if ( ( is_admin() && ! defined('DOING_AJAX') ) || ! is_checkout() )
return;
$subtotal = WC()->cart->get_subtotal();
$percentage = 5;
$discount = $subtotal * $percentage / 100;
// Give 5% discount if and when the switch is toggled
if( WC()->session->get('enable_discount') ) {
$cart->add_fee( sprintf( __( 'Company Discount (%s)','woocommerce'),$percentage .'%' ),-$discount );
}
}
脚本:
chr start end value
chr1 58708485 58708713 1
chr1 58709084 58710538 2
chr1 98766295 98766639 3
chr1 98766902 98770338 4
我不确定如何为单个文件设置查询和主题,以及作为文档的对象需要任何类型的“”或特定格式(bedGraph、txt 可以吗?)才能被识别在脚本中?
非常感谢您的帮助!
K.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。