Révision a0b91fee src/R/nucleominer.R

b/src/R/nucleominer.R
470 470
	strain_ref1 = replicates[[1]][[1]]$strain
471 471
	strain_ref2 = replicates[[2]][[1]]$strain
472 472
	big_roi = replicates[[1]][[1]]$roi
473
  orig_big_roi = replicates[[1]][[1]]$orig_roi
473 474
	if(big_roi$end - big_roi$begin < 0) {
474 475
		tmp_begin = big_roi$begin
475 476
		big_roi$begin =  big_roi$end
476 477
		big_roi$end =  tmp_begin
477 478
	}
478
  tr_big_roi = translate_roi(big_roi, strain_ref2, config=config)
479
	if(tr_big_roi$end - tr_big_roi$begin < 0) {
480
		tr_tmp_begin = tr_big_roi$begin
481
		tr_big_roi$begin = tr_big_roi$end
482
		tr_big_roi$end = tr_tmp_begin
483
	}
484
	# print(big_roi)
485 479
	# GO!
486 480
	if (is.null(wp_nucs_strain_ref1)) {
487 481
		wp_nucs_strain_ref1 = aggregate_intra_strain_nucs(replicates[[1]], ...)[[1]]
......
510 504
			# Filtering on Well Positionned
511 505
			if (nuc_strain_ref1$wp) {
512 506
				roi_strain_ref1 = list(name=paste("strain_chr_id_" , strain_ref1 , "_" , chr , "_" , "i" , "_", sep=""), begin=nuc_strain_ref1$lower_bound, end=nuc_strain_ref1$upper_bound, chr=chr, strain_ref = strain_ref1)
513
				roi_strain_ref2 = translate_roi(roi_strain_ref1, strain_ref2, big_roi=big_roi, config=config) 
507
				roi_strain_ref2 = translate_roi(roi_strain_ref1, strain_ref2, big_roi=orig_big_roi, config=config) 
514 508
        if (!is.null(roi_strain_ref2)){
515 509
					# LOADING INTRA_STRAIN_NUCS_FILENAME_STRAIN_REF2 FILE(S) TO COMPUTE MATCHING_NAS (FILTER)
516 510
					lower_bound_roi_strain_ref2 = min(roi_strain_ref2$end,roi_strain_ref2$begin)
......
520 514
						nuc_strain_ref2 = wp_nucs_strain_ref2[[index_nuc_strain_ref2]]
521 515
						# Filtering on Well Positionned
522 516
    				nuc_strain_ref2_to_roi = list(begin=nuc_strain_ref2$lower_bound, end=nuc_strain_ref2$upper_bound, chr=nuc_strain_ref2$chr, strain_ref = strain_ref2)             
523
						if (!(tr_big_roi$chr!=nuc_strain_ref2$chr | 
524
                  nuc_strain_ref2$upper_bound > tr_big_roi$end | 
525
                  nuc_strain_ref2$upper_bound < tr_big_roi$begin | 
526
                  nuc_strain_ref2$lower_bound > tr_big_roi$end | 
527
                  nuc_strain_ref2$lower_bound < tr_big_roi$begin) &
528
                !is.null(translate_roi(nuc_strain_ref2_to_roi, strain_ref1, big_roi=big_roi, config=config)) &  
517
						if (!is.null(translate_roi(nuc_strain_ref2_to_roi, strain_ref1, big_roi=orig_big_roi, config=config)) &  
529 518
                nuc_strain_ref2$wp) {
530 519
							# Filtering on correlation Score and collecting reads					
531 520
							SKIP = FALSE
......
707 696
  samples_ids = unique(all_samples[all_samples$marker == "Mnase_Seq" & all_samples$strain == strain,]$id)
708 697
	for (i in samples_ids) {
709 698
		sample = as.list(all_samples[all_samples$id==i,])
699
    sample$orig_roi = roi
710 700
    sample$roi = translate_roi(roi, sample$strain, config = config)
711 701
		if (get_genome) {
712 702
			# Get Genome
......
1781 1771
  	samples=list()
1782 1772
  	for (i in samples_ids) {
1783 1773
  		sample = as.list(all_samples[all_samples$id==i,])
1774
      sample$orig_roi = roi
1784 1775
      sample$roi = translate_roi(roi, sample$strain, config = config)
1785 1776
  		if (get_genome) {
1786 1777
  			# Get Genome

Formats disponibles : Unified diff